0

我们有什么:

  • 柯南服务器,版本 1.35.0
  • Artifactory cpp-ce 版本 7.17.5

我们想要什么:

将 conan_server 作为远程添加到 Artifactory。

我们所做的:

在 Artifactory 中创建新的遥控器,然后使用 100% 正确的服务器名称和凭据(用户和密码)进行设置。

我们得到了什么:

Artifactory 无法向 conan_server 进行身份验证。

您可以在下面看到请求,conan 客户端使用这些请求对 conan_server 进行身份验证(正确授权):

一、基本认证

GET /v1/users/authenticate HTTP/1.1
Host: serverhost:9300
User-Agent: Conan/1.31.3 (Python 3.6.9) python-requests/2.25.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Client-Anonymous-Id: e468058b6da56d6c83463a5695d2e72f40bf457e
X-Client-Id: demo
Authorization: Basic ***********

使用令牌响应:

HTTP/1.0 200 OK
Date: Thu, 08 Apr 2021 08:45:46 GMT
Server: WSGIServer/0.2 CPython/3.5.3
Content-Length: 124
Content-Type: text/plain

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiZGVtbyIsImV4cCI6MTYxNzg3ODc0Nn0.aZJlLSPXIzHKfX_zohmxf0wO990RHjDzMer1yDoyviA
clienthost - - [08/Apr/2021 11:45:46] "GET /v1/users/authenticate HTTP/1.1" 200 124

然后使用token进行授权:

GET /v2/conans/search HTTP/1.1
Host: serverhost:9300
User-Agent: Conan/1.31.3 (Python 3.6.9) python-requests/2.25.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
X-Client-Anonymous-Id: e468058b6da56d6c83463a5695d2e72f40bf457e
X-Client-Id: demo
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiZGVtbyIsImV4cCI6MTYxNzg3ODc0Nn0.aZJlLSPXIzHKfX_zohmxf0wO990RHjDzMer1yDoyviA

这是 Artifactory 的身份验证尝试:

GET /v2/conans/search HTTP/1.1
Connection: Keep-Alive
X-Artifactory-Originated: c16481e7214b64d1:5326f2e9:178b18bceca:-8000
Origin-Artifactory: c16481e7214b64d1:5326f2e9:178b18bceca:-8000
Accept-Encoding: gzip
uber-trace-id: e86d87a0be0ac1f4:e86d87a0be0ac1f4:e86d87a0be0ac1f4:0
Host: serverhost:9300
User-Agent: Artifactory/7.11.5 71105900
Authorization: Basic ZGVtbzpkZW1v

和服务器的答案:

HTTP/1.0 401 Unauthorized
Date: Thu, 08 Apr 2021 13:25:21 GMT
Server: WSGIServer/0.2 CPython/3.5.3
Content-Length: 37
Content-Type: text/html; charset=UTF-8

'Http Authentication not implemented'
4

0 回答 0