我们有一个自定义 Grails 应用程序,它使用 Spring Security 进行 LDAP 身份验证。用户 DN 包含逗号(例如,“CN=Smith\, John,CN=Users,DC=example,DC=com”),但我们的管理员用户的 DN 不包含逗号(例如,“CN=peadmin,CN=Users,DC =示例,DC = com“)。当我从本质上是 Tomcat 的 Grails 服务器运行应用程序时,一切都可以正常验证。当我构建 WAR 并部署到 WebSphere AS 7 时,我只能使用 admin 用户登录。我们日志中的异常抱怨一个意外的逗号,它表示应用程序在 WAS 上运行时没有正确解析/转义 DN。
升级到 Spring Security 3.0.4 后,我们得到的具体异常信息如下:
2011-04-07 20:58:41,975 [WebContainer:0] 错误 controller.LoginController - org.springframework.security.authentication.AuthenticationServiceException:解析 DN 失败;嵌套异常是 org.springframework.ldap.core.ParseException: Encountered "" at line 1, column 20. 期待:...