Spring Security CAS authentication + LDAP Roles combo?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Spring Security CAS authentication + LDAP Roles combo?

ynotlim
This post has NOT been accepted by the mailing list yet.
Hi,

I've setup Spring-Security-CAS and Spring-Security-LDAP.  Both work as they should, but I want to authenticate through CAS and have it load up the LDAP roles.  Any advice on how to do this?  Has someone done it already?

Thanks!

Tony
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Spring Security CAS authentication + LDAP Roles combo?

ynotlim
This post has NOT been accepted by the mailing list yet.
here's an example.  How do I implement this for Grails though?

http://forum.springsource.org/showthread.php?t=47094

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Spring Security CAS authentication + LDAP Roles combo?

ynotlim
This post has NOT been accepted by the mailing list yet.
finally figured it out.  Here's the solution


resources.groovy --------------------------------------------
// Place your Spring DSL code here
beans = {
    // load ldap roles from spring security
    initialDirContextFactory(org.springframework.security.ldap.DefaultSpringSecurityContextSource,
        "ldap://..."){
        userDn = "CN=adminusername,DC=TEST,DC=TEST,DC=COM"
        password = "..."
    }

    ldapUserSearch(org.springframework.security.ldap.search.FilterBasedLdapUserSearch,
        "DC=TEST,DC=TEST,DC=COM","(sAMAccountName={0})",initialDirContextFactory){

    }

    ldapAuthoritiesPopulator(org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator,
        initialDirContextFactory,"DC=TEST,DC=TEST,DC=COM"){
          groupRoleAttribute = "cn"
          groupSearchFilter = "member={0}"
          searchSubtree = true
          rolePrefix = "ROLE_"
          convertToUpperCase = true
          ignorePartialResultException = true
    }

    userDetailsService(org.springframework.security.ldap.userdetails.LdapUserDetailsService,ldapUserSearch,ldapAuthoritiesPopulator){
    }
}
Loading...