2016-10-13 83 views
0

我在Grails中使用LDAP授權(驗證工作)苦苦掙扎。這是我的配置:Grails Spring Security LDAP「defaultRole」未分配

grails.plugin.springsecurity.ldap.auth.hideUserNotFoundExceptions = false 
grails.plugin.springsecurity.ldap.search.filter = 'sAMAccountName={0}' 
grails.plugin.springsecurity.ldap.search.searchSubtree = true 
grails.plugin.springsecurity.ldap.authorities.ignorePartialResultException = true 
grails.plugin.springsecurity.ldap.authorities.defaultRole = 'ROLE_USER' 
grails.plugin.springsecurity.ldap.authorities.retrieveDatabaseRoles = true 
grails.plugin.springsecurity.ldap.authorities.retrieveGroupRoles = false  
grails.plugin.springsecurity.ldap.useRememberMe = false 

我厚望獲得分配「ROLE_USER」角色的用戶,但我得到的是:

DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository - Obtained a valid SecurityContext from SPRING_SECURITY_CONTEXT: '[email protected]6fe506: Authentication: org.springframew[email protected]d66fe506: Principal: or[email protected]d66d0e48: Dn: cn=testuser,cn=Users,dc=GROUP,dc=LOCAL; Username: testuser; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; CredentialsNonExpired: true; AccountNonLocked: true; Not granted any authorities; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]fffd148a: RemoteIpAddress: 127.0.0.1; SessionId: 2BA8D2C334CBDA358EEEAD97F12DD38C; Not granted any authorities' 

你有沒有智慧的任何單詞?我究竟做錯了什麼?

回答

0

只爲我找到了解決方案的紀錄是retrieveGroupRoles切換到真:

grails.plugin.springsecurity.ldap.authorities.retrieveGroupRoles = true 
相關問題