本文介绍了grails:只有spring-security和LDAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下错误:

  2011-06-27 17:23:57,241 [http-8080- 1] DEBUG authentication.LdapAuthenticationProvider  - 处理认证请求使用
r:nvb0343
2011-06-27 17:23:57,241 [http-8080-1] DEBUG search.FilterBasedLdapUserSearch - 正在搜索用户'xxxxxx' ,用户搜索[s
earchFilter:'sAMAccountName = {0}',searchBase:'DC = GrupoCGD,DC = com',范围:子树,searchTimeLimit:0,d​​erefLinkFlag:true]
2011- 06-27 17:23:57,272 [http-8080-1] DEBUG rememberme.TokenBasedRememberMeServices - 交互式登录尝试失败。

2011-06-27 17:23:57,272 [http-8080-1] DEBUG rememberme.TokenBasedRememberMeServices - 取消cookie
2011-06-27 17:23:57,272 [http-8080 -1] DEBUG web.DefaultRedirectStrategy - 重定向到'/ fce-test-app / login / authfail?login_erro
r = 1'
2011-06-27 17:23:57,272 [http-8080-1 ] DEBUG context.SecurityContextPersistenceFilter - SecurityContextHolder现在被清除,因为需求
est处理完成
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.FilterChainProxy - 将URL转换为小写,来自:'/ login / authfail'; to:'/ log
in / authfail'
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.FilterChainProxy - 候选人是:'/ login / authfail';模式是/ **;匹配= true
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.FilterChainProxy - / login / authfail?login_error = 1位于第8位,位于额外的
过滤器链中;这是我的配置:


$ b $



$ b

b

  grails.plugins.springsecurity.ldap.search.derefLink = true 
grails.plugins.springsecurity.providerNames = ['ldapAuthProvider','anonymousAuthenticationProvider']

//grails.plugins.springsecurity.ldap.authorities.retrieveDatabaseRoles = false
grails.plugins.springsecurity.ldap.context.managerDn ='XXX\XXX'
grails.plugins。 springsecurity.ldap.context.managerPassword ='changeme'
grails.plugins.springsecurity.ldap.context.server ='ldap://my.ldap.service:389 /'
grails.plugins.springsecurity .ldap.authorities.ignorePartialResultException = true //通常需要Active Directory
grails.plugins.springsecurity.ldap.search.base ='DC = XXX,DC = com'
grails.plugins.springsecurity。 ldap.search.filter =sAMAccountName = {0}//对于Active Directory,您需要
grails.plugins.springsecu rity.ldap.search.searchSubtree = true
grails.plugins.springsecurity.ldap.auth.hideUserNotFoundExceptions = false

grails.plugins.springsecurity.ldap.useRememberMe = false
grails .plugins.springsecurity.ldap.authorities.retrieveGroupRoles = true
grails.plugins.springsecurity.ldap.authorities.groupSearchBase ='dc = *,dc = *'
grails.plugins.springsecurity.ldap.authorities .groupSearchFilter ='member = {0}'

我已经尝试过gazillions的组合,但似乎那些grails总是试着 rememberMe 服务:
$ b rememberme.TokenBasedRememberMeServices - 交互式登录尝试失败 code>

解决方案

我设法解决了这个问题。这是一个配置错误。这是后人的链接:


I'm having the following error:

2011-06-27 17:23:57,241 [http-8080-1] DEBUG authentication.LdapAuthenticationProvider  - Processing authentication request for use
r: nvb0343
2011-06-27 17:23:57,241 [http-8080-1] DEBUG search.FilterBasedLdapUserSearch  - Searching for user 'xxxxxx', with user search [ s
earchFilter: 'sAMAccountName={0}', searchBase: 'DC=GrupoCGD,DC=com', scope: subtree, searchTimeLimit: 0, derefLinkFlag: true ]
2011-06-27 17:23:57,272 [http-8080-1] DEBUG rememberme.TokenBasedRememberMeServices  - Interactive login attempt was unsuccessful.

2011-06-27 17:23:57,272 [http-8080-1] DEBUG rememberme.TokenBasedRememberMeServices  - Cancelling cookie
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.DefaultRedirectStrategy  - Redirecting to '/fce-test-app/login/authfail?login_erro
r=1'
2011-06-27 17:23:57,272 [http-8080-1] DEBUG context.SecurityContextPersistenceFilter  - SecurityContextHolder now cleared, as requ
est processing completed
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.FilterChainProxy  - Converted URL to lowercase, from: '/login/authfail'; to: '/log
in/authfail'
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.FilterChainProxy  - Candidate is: '/login/authfail'; pattern is /**; matched=true
2011-06-27 17:23:57,272 [http-8080-1] DEBUG web.FilterChainProxy  - /login/authfail?login_error=1 at position 1 of 8 in additional
 filter chain; firing Filter: 'SecurityContextPersistenceFilter'

here's my config:

grails.plugins.springsecurity.ldap.search.derefLink = true
grails.plugins.springsecurity.providerNames = ['ldapAuthProvider','anonymousAuthenticationProvider']

//grails.plugins.springsecurity.ldap.authorities.retrieveDatabaseRoles = false
grails.plugins.springsecurity.ldap.context.managerDn = 'XXX\XXX'
grails.plugins.springsecurity.ldap.context.managerPassword = 'changeme'
grails.plugins.springsecurity.ldap.context.server = 'ldap://my.ldap.service:389/'
grails.plugins.springsecurity.ldap.authorities.ignorePartialResultException = true // typically needed for Active Directory
grails.plugins.springsecurity.ldap.search.base = 'DC=XXX,DC=com'
grails.plugins.springsecurity.ldap.search.filter="sAMAccountName={0}" // for Active Directory you need this
grails.plugins.springsecurity.ldap.search.searchSubtree = true
grails.plugins.springsecurity.ldap.auth.hideUserNotFoundExceptions = false

grails.plugins.springsecurity.ldap.useRememberMe = false
grails.plugins.springsecurity.ldap.authorities.retrieveGroupRoles = true
grails.plugins.springsecurity.ldap.authorities.groupSearchBase ='dc=*,dc=*'
grails.plugins.springsecurity.ldap.authorities.groupSearchFilter = 'member={0}'

I've tried gazillions of combinations, but it seems that grails always tries the rememberMe service:

rememberme.TokenBasedRememberMeServices - Interactive login attempt was unsuccessful

解决方案

I've managed to solve it. It was a configuration error. Here's a link for posterity: https://gist.github.com/1053710

这篇关于grails:只有spring-security和LDAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-09 22:44