Hi,
Ldaploginmodule of Jboss does the authentication and authorization. (Sample
code provided below)
Assume that ldaploginmodule configured in auth.conf , users & roles are
configured in ldap.
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?
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();
}
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3885913#3885913
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3885913
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user