0 Replies Latest reply on Jul 23, 2005 3:25 AM by Siva Uppari

    URGNET - How to access configuration parameters of login-con

    Siva Uppari Newbie

      Hi,

      ldaploginmodule is configured in login-config.xml. sample given below.

      Can anyone provide me the sample code to access these parameters?
      For eg:

      String rolesCtxDN = (String) options.get(ROLES_CTX_DN_OPT);
      String userRolesCtxDNAttributeName = (String) options.get(USER_ROLES_CTX_DN_ATTRIBUTE_ID_OPT);

      When this ldaploginmodule is being called using JAAS, then these parameters will be accessed inside ldaploginmodule class...My requirement need to develop DTO's which connects to ldap server and fetches user roles and profile.


      Congiration:

      <application-policy name = "DDDDomain">

      <login-module code = "org.jboss.security.auth.spi.LdapLoginModule" flag="required">
      <module-option name = "java.naming.factory.initial">
      com.sun.jndi.ldap.LdapCtxFactory
      </module-option>
      <module-option name = "java.naming.provider.url">ldap://localhost:7001/</module-option>
      <module-option name = "java.naming.security.authentication">simple</module-option>
      <module-option name = "principalDNPrefix">uid=</module-option>
      <module-option name = "uidAttributeID">roleOccupant</module-option>
      <module-option name = "roleAttributeID">cn</module-option>
      <module-option name = "principalDNSuffix">,ou=people,ou=myrealm,dc=DEMO</module-option>
      <module-option name = "rolesCtxDN">ou=ERole,ou=myrealm,dc=DEMO</module-option>
      <module-option name = "matchOnUserDN">true</module-option>
      <module-option name = "unauthenticatedIdentity">nobody</module-option>
      </login-module>

      </application-policy>