我在使用LDAP验证用户时遇到麻烦,我已经配置了我的server.xml和我的web.xml,问题是页面总是重定向到错误页面但是日志没有显示任何消息或错误,我已阅读有关必须导入JVM的SSL证书(我不知道该怎么做,是否有必要?)
有人知道这是什么问题吗?
的web.xml
<security-constraint>
<display-name>Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>/admin/*</url-pattern>
<!-- If you list http methods, only those methods are protected -->
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Form-Based Authentication Area</realm-name>
<form-login-config>
<form-login-page>/view/portal/login.jsp</form-login-page>
<form-error-page>/authentication/login.xhtml</form-error-page>
</form-login-config>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<role-name>admin</role-name>
</security-role>
server.xml中
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionName="uid=......,ou=profile,dc=domain,dc=com"
connectionPassword="password"
connectionURL="ldap://domain"
userPattern="uid={0},ou=people,dc=domain,dc=com"
roleBase="ou=group,dc=domain,dc=com"
roleName="cn"
roleSearch="memberUid={1}"
/>