[JBoss-user] [Security & JAAS/JBoss] - URGNET - How to access configuration parameters of login-con

2005-07-23 Thread siva.prasad
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:


  

  
com.sun.jndi.ldap.LdapCtxFactory
  
  ldap://localhost:7001/
  simple
  uid=
  roleOccupant
  cn
  ,ou=people,ou=myrealm,dc=DEMO
  ou=ERole,ou=myrealm,dc=DEMO
  true

  nobody

  



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3886204#3886204

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3886204


---
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
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Security & JAAS/JBoss] - JAAS/LDAP - retrieve user roles from ldap using ldaploginmod

2005-07-21 Thread siva.prasad
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
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user