部署时使用Nexus远程用户令牌授权

时间:2015-06-11 11:19:58

标签: nexus sonatype

我对Nexus RUT功能有疑问。设置完成后,获取http标头读取,将此用户名添加到security.xml并将角色映射到此用户,我可以在Sonatype Nexus GUI中进行授权。

问题是,在尝试使用Maven将工件部署到Nexus存储库时,如何进行授权?

curl -I http://localhost:8080/nexus/service/local/status

返回

HTTP/1.1 401 Unauthorized
Date: Thu, 11 Jun 2015 10:41:59 GMT
Server: Nexus/2.11.3-01
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
WWW-Authenticate: BASIC realm="Sonatype Nexus Repository Manager API"
Content-Length: 0

但是

curl -I -H "X-Forwarded-User: admin" http://localhost:8080/nexus/content/

返回

HTTP/1.1 200 OK
Date: Thu, 11 Jun 2015 10:44:35 GMT
Server: Nexus/2.11.3-01
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Accept-Ranges: bytes
Last-Modified: Thu, 11 Jun 2015 10:44:35 GMT
Content-Length: 0

在maven项目中使用凭据并尝试在this之后部署网站,我收到错误

Uploading: .//project-summary.html to https://my.site.com/nexus/content/sites/site/
[WARNING] Required credentials not available for BASIC <any realm>@federation-sts.site.com:443
[WARNING] Preemptive authentication requested but no default credentials available
https://federation-sts.site.com/adfs/ls/?SAMLRequest=fZJdT4Mw........... - Status code: 200
Transfer finished. 5671 bytes copied in 0.404 seconds
 Transfer error: java.io.IOException: Unable to create collection: https://my.site.com/nexus/; status code = 302

非常感谢你的帮助,谢谢!

0 个答案:

没有答案