无法让Apache Archiva使用LDAP

时间:2011-11-11 23:47:14

标签: ldap archiva

我已取消注释application.xml中的LDAP和UserMapper连接器

我知道我的LDAP凭据(binddn,hostname等)都在运行,因为我对我服务器上的其他应用程序使用LDAP身份验证和授权。

我所做的就是对application.xml和security.properties进行更改。还有别的我应该做的吗?

当我尝试从LDAP登录用户时,它不成功。有没有我可以查看的日志文件,看看出了什么问题?我发现archiva文档稀疏而简洁。

这是我的security.properties文件 - 某些值已被更改,也许有人可以验证结构是否正常:

# LDAP
user.manager.impl=ldap
ldap.bind.authenticator.enabled=true
redback.default.admin=admin
security.policy.password.expiration.enabled=false

ldap.config.hostname=localhost
ldap.config.port=389
ldap.config.base.dn=domainName=mydomain.com,o=domains,dc=mydomain,dc=com
ldap.config.context.factory=com.sun.jndi.ldap.LdapCtxFactory
ldap.config.bind.dn=cn=Manager,dc=mydomain,dc=com
ldap.config.password=mypass

ldap.config.mapper.attribute.email=mail
ldap.config.mapper.attribute.fullname=displayName
ldap.config.mapper.attribute.password=userPassword
ldap.config.mapper.attribute.user.id=mail
ldap.config.mapper.attribute.user.base.dn=ou=Users
ldap.config.mapper.attribute.user.object.class=inetOrgPerson
ldap.config.mapper.attribute.user.filter=(objectclass=inetOrgPerson)

另外,config.mapper.attribute.user.base.dn让我感到困惑。我的用户的基础在这里: OU =用户,则domainName = mydomain.com,O =域,DC = MYDOMAIN,DC = COM

这对于我放入的基本DN意味着什么:domainName = scoresecret.com,o = domains,dc = scoresecret,dc = com

和config.mapper.attribute.user.base.dn:ou = Users

让我知道如果我做错了什么,如果我忘了做一些事情来“切换LDAP”,如果我能找到一些日志来指出我正确的方向。万分感谢

1 个答案:

答案 0 :(得分:1)

确保您已配置LDAP中存在的管理员用户 - 此时无法使用内部用户。

redback.default.admin=admin

admin替换为LDAP服务器中可用于此目的的角色帐户。

这是我使用的配置模板,它应该显示您需要填充的值: https://github.com/maestrodev/puppet-archiva/blob/master/templates/security.properties.erb

似乎主要的区别可能是用户过滤器是空的?

(另请参阅users@archiva.apache.org上的主题:http://s.apache.org/KDj