Retrieving user and group information from LDAP using j_securrity_check
Hi
I am using j_security_check to authenticate users against LDAP. I have made all necessary configuration for the server to perform LDAP group search as well as mentioned in the WAS documentation of LDAP settings. Now, how can I retrieve the user and the user group info after the j_secuirty_check. Apart from the UserPrincipal object which I can get from the request which just has the user name, is there any other object which will give me the user and user group info by which I need to connect to LDAP using my java code to retrieve these informations?
Regards
Deepak
> Hi
>
> I am using j_security_check to authenticate users
> against LDAP. I have made all necessary configuration
> for the server to perform LDAP group search as well
> as mentioned in the WAS documentation of LDAP
> settings. Now, how can I retrieve the user and the
> user group info after the j_secuirty_check.
> Apart
> from the UserPrincipal object which I can get from
> the request which just has the user name, is there
> any other object which will give me the user and user
> group info by which I need to connect to LDAP using
> my java code to retrieve these informations?
Hmm, you don't need the user group info to connect to the LDAP server, right? You would need the user's Id (which you have) and password (which you don't). You could use the LDAP credentials and bind as that to look up the user info via the user id. Or if the server is set up to allow anonymous bind you could do it without credentials. But if all you want is group info then you should be able to call Security.getCurrentSubject().getPrincipals() to get the user principal as well as all groups (this is true in BEA WebLogic at least).
Good Luck
Lee
tsitha at 2007-7-12 16:27:06 >

Ah, sorry - I was using weblogic.security.Security. I poked around the websphere docs and came across this:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzatz/51/sec/secdjaas.htm
But I must admit I don't see an easy way to get the current subject. I've not looked that hard though.
Sorry!
Lee
tsitha at 2007-7-12 16:27:06 >
