Announcement Announcement Module
No announcement yet.
Acegi Plugin Exception: No such property: domainClass for LdapUserDetailsImpl Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi Plugin Exception: No such property: domainClass for LdapUserDetailsImpl

    I have the Acegi plugin installed in an example web app and when I visit the User, Role or Requestmap, I get the following exception:

    SecurityConfig.groovy: Loading LDAP Config...
    SecurityConfig.groovy: Setting up request map...
    2010-04-22 15:19:20,377 [http-8080-1] ERROR errors.GrailsExceptionResolver - No such property: domainClass for class: UserDetailsImpl
    groovy.lang.MissingPropertyException: No such property: domainClass for class: UserDetailsImpl
    at AcegiGrailsPlugin$_addControllerMethods_closure23. doCall(AcegiGrailsPlugin.groovy:926)
    at AcegiGrailsPlugin$_addControllerMethods_closure23. doCall(AcegiGrailsPlugin.groovy)
    at RoleController$_closure1.doCall(RoleController.gro ovy:15)
    at RoleController$_closure1.doCall(RoleController.gro ovy)
    Searching through the code, I see plenty of domainClass fields but not one for LdapUserDetailsImpl.

    My resources.config has:

    import urityContextSource;
    import UserDetailsMapper;
    import org.codehaus.groovy.grails.plugins.springsecurity. *;

    beans = {

    println "resources.groovy: ..."

    // Acegi configuration:
    println "resources.groovy: Acegi configuration..."
    def conf =
    // Initialize Acegi LDAP Context to support referral.
    contextSource(DefaultSpringSecurityContextSource, conf.ldapServer) {
    userDn = conf.ldapManagerDn
    password = conf.ldapManagerPassword
    baseEnvironmentProperties = ['java.naming.referral': 'follow']
    // The Acegi plugin assumes that there's a user in the database with the same username as the LDAP user.
    // If you don't have user data in the database we'll get exceptions.
    // This workaround will allow us to keep everything in AD.
    ldapUserDetailsMapper(LdapUserDetailsMapper) {
    passwordAttributeName = conf.ldapPasswordAttributeName
    and my SecurityConfig.groovy (configured for AD) is:

    security {

    // see DefaultSecurityConfig.groovy for all settable/overridable properties

    active = true
    loginUserDomainClass = "User"
    authorityDomainClass = "Role"
    requestMapClass = "Requestmap"

    // Use Active Directory to access users but not Roles.
    println "SecurityConfig.groovy: Loading LDAP Config..."
    useLdap = true
    ldapSearchSubtree = true
    ldapServer = 'ldap://'
    ldapManagerDn = 'CN=Portal Admin,OU=Users,OU=IS,OU=Hendersonville,OU=Americas ,DC=Sygen,DC=Sygeninternational,DC=com'
    ldapManagerPassword = 'SeeKret'
    ldapSearchBase = 'dc=sygen,dc=sygeninternational,dc=com'
    ldapSearchFilter = '(sAMAccountName={0})'
    ldapGroupRoleAttribute = 'CN'
    ldapGroupSearchBase = 'dc=sygen,dc=sygeninternational,dc=com'
    ldapGroupSearchFilter = '(member={0})'
    ldapRetrieveGroupRoles = true
    ldapRetrieveDatabaseRoles = true

    println "SecurityConfig.groovy: Setting up request map..."
    useRequestMapDomainClass = true;
    requestMapString = '''

    The ROLE_APP-GMS-MP-USERS is stored in Active Directory. The ROLE_ADMIN and ROLE_SUPER is in the database. The requestmap in the
    database is not currently protecting /user, /role, or /requestmap.

    Can anyone give me a hint? Thanks.

  • #2
    You should ask Grails plugin questions on the Grails user mailing list - most people on this forum don't use Grails:


    • #3
      Good idea. Thanks.