在这一点上,我的Ldap服务器有这个用户:

MyLdap服务器的密码为管理员。
我的Glassfish控制台有这样的配置:

我的web.xml是这样的:
<security-constraint>
<display-name>Private</display-name>
<web-resource-collection>
<web-resource-name>secret</web-resource-name>
<description/>
<url-pattern>/secured/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>HEAD</http-method>
<http-method>PUT</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>secure</role-name>
</auth-constraint>
</security-constraint>我的sun-web.xml包含以下内容:
<security-role-mapping>
<role-name>secure</role-name>
<group-name>users</group-name>
</security-role-mapping>当我想进行身份验证时,我引入1作为用户名(uid),并引入catia (对应于userPassword)作为密码。
我不能登录。我做错了什么?
发布于 2015-01-26 16:10:31
我不熟悉glassfish LDAP配置,但至少您的Base-DN似乎是错误的:根据屏幕截图,"ou=users,ou=system“应该是正确的值。
"search-bind- DN“值似乎也不正确:我假设它应该是您的LDAP Admin用户的DN,例如uid=admin、ou=system。
也许sun-web.xml中使用的security-role-mapping也应该在"Assign Groups“字段中定义一个相应的组(它现在是空的)。
https://stackoverflow.com/questions/28142636
复制相似问题