1 Reply Latest reply on Dec 28, 2012 3:01 AM by Nicklas Karlsson

    Programmatically access JBoss Security realm

    Tapas Bose Newbie

      I have defined a realm in standalone.xml which is:

       

      <security-domain name="adbRealm" cache-type="default">

          <authentication>

              <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">

                  <module-option name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory"/>

                  <module-option name="java.naming.provider.url" value="ldap://XXX.XXX.XXX.XXX:XXXX/"/>

                  <module-option name="java.naming.security.authentication" value="simple"/>

                  <module-option name="principalDNPrefix" value="uid="/>

                  <module-option name="principalDNSuffix" value=",ou=people,dc=x,dc=y,dc=co,dc=in"/>

                  <module-option name="rolesCtxDN" value="ou=roles,dc=x,dc=y,dc=co,dc=in"/>

                  <module-option name="uidAttributeID" value="uniqueMember"/>

                  <module-option name="matchOnUserDN" value="true"/>

                  <module-option name="roleAttributeID" value="cn"/>

                  <module-option name="roleAttributeIsDN" value="false"/>

              </login-module>

          </authentication>

      </security-domain>

       

      Now I want to read the realm and want to get the URL and dn from the backend by accessing the instance of org.jboss.security.auth.spi.LdapLoginModule corresponds to security-domain adbRealm or any other way. So that I can have these two properties.

      Is it possible? Any pointer would be very helpful.