Hi,

Ldaploginmodule of Jboss used for the authentication and authorization.

Assume that ldaploginmodule configured in ldap.conf , users & roles are configured in ldap.

Sample Code:

try {
System.getProperties().setProperty("java.security.auth.login.config",TestConnect.class.getClassLoader().getResource("ldap.conf").toExternalForm());
LoginContext loginContext = new LoginContext("ldapClient", new
UsernamePasswordCallbackHandler("username", "password"));
loginContext.login();

// How to retrieve the user roles from ldaploginmodule

} catch (NamingException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
} catch (CreateException e) {
e.printStackTrace();
} catch (LoginException e) {
e.printStackTrace();
}

logincontext.login() --> This performs authentication with LDAP using ldaploginmodule, Also retrieves the roles assigned to that user and assign them to one of the ldaploginmodule attribute.

These roles can be retrieved using gerRoleSets() method of ldaploginmodule.

As the Client directly not interacting with ldaploginmodule instead this module has being called form logincontext class. Logincontext class does not provide methods to call gerRolesSet().

How to retrieve these user roles? does this retrieval using logincontext or any other alternate approach?