JBoss Community

Programmatically access JBoss Security realm

created by Tapas Bose in JBoss AS 7 Development - View the full discussion

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

 

{code}

<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>

{code}

 

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.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community