用于SSO的Nexus OSS远程用户令牌(RUT)

时间:2015-10-02 14:21:32

标签: single-sign-on nexus

您好我正在使用Nexus OSS,并希望使用远程用户令牌模拟SSO。目前,Nexus已配置为LDAP身份验证,并且工作正常。

根据https://books.sonatype.com/nexus-book/reference/rutauth.html

中的说明

基本启用的远程用户令牌和添加的标题字段名称“REMOTE_USER”。该用户是ldap并具有访问权限。

这个实例是apache的后面,所以从apache开始,为了测试这个RUT,我可以设置头值REMOTE_USER,无论是谁,我看不到传入用户的记录,也没看到生成cookie。我甚至尝试过firefox rest api客户端并设置标题,但结果相同。我可以看到HTTP标头设置正确。

我错过了什么吗?

有没有办法调试?感谢任何帮助。

由于

取值

2 个答案:

答案 0 :(得分:0)

RUT处理身份验证,但仍需要经过身份验证的用户才能访问Web UI。这意味着您需要在Nexus中为LDAP用户或组映射,为用户分配必要的角色和权限。

答案 1 :(得分:0)

我在Nginx上遇到了类似的问题,未使用正确的值设置标头。 这可能非常令人困惑,因为反向代理不会抱怨,而只是向Nexus发送空白的请求标头。

使用Keycloak和Nginx(Lua),而不是IdP响应中的preferred_username字段:

-- set headers with user info: this will overwrite any existing headers
-- but also scrub(!) them in case no value is provided in the token
ngx.req.set_header("X-Proxy-REMOTE-USER", res.preferred_username)

我必须使用响应的preferred_username元素中返回的id_token字段:

-- set headers with user info: this will overwrite any existing headers
-- but also scrub(!) them in case no value is provided in the token
ngx.req.set_header("X-Proxy-REMOTE-USER", res.id_token.preferred_username)