tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: How to get authenticated user's DirContext from JNDIRealm?
Date Wed, 09 May 2007 23:58:51 GMT
You could use request.getUserPrincipal but JNDIRealm doesn't create a 
Principal with the details you need.

That being said - your own code might be the way to go. (An "easy" 
solution could be to create a servlet filter which wraps the servlet 
request and overrides getUserPricipal to return the principal you need.


Mark Roy wrote:
> I'm using the JNDIRealm to connect to LDAP for user authentication. It's
> working great. (I'm using Tomcat 5.0)
> My question is: Is there a way for my .jsp to get more information about the
> authenticated user, e.g. email address or other attributes stored in the
> directory? In other words, is there a way to get the DirContext of the
> authenticated user? Lacking that, is there a way to get the user's
> distinguished name?
> Or, do I have to add my own code to do another search+bind+lookup on the
> user returned from request.getAuthUser()?

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message