• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

how to get mod_ldap authenticated user information in java

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My httpd.conf in IHS looks like this





Now as per Apache documentation I am expecting values in environment variables :
System.getenv("AUTHENTICATE_CN"),
System.getenv("AUTHENTICATE_MAIL") and
System.getenv("AUTHENTICATE_DEPT")

but all I get is NULL. I am only getting the authenticated email id in request.getRemoteUser(). I also tried System.getProperties(), but nothing there also. Please let me know how I can get the other informations.

Thanks in advance.
 
Bartender
Posts: 20940
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume that "IHS" means "IBM Http Server". It would be an IBM-specific replacement for the Apache HTTP server that they originally included to front WebSphere. The HTTP server(IHS/Apache) and the J(2)EE server (WebSphere) are 2 separate applications, so the only information that they can share is information in the data stream itself.

Apache's mod_ldap is not a general-purpose LDAP search function, it's a filter that demands a simple yes/no response in terms of whether a user's login credentials match the LDAP database.

If you want general information from LDAP about a user, then the web application needs to do an actual LDAP search of its own. You can do this in Java by using the userid returned by getRemoteUser() as the key to the LDAP search. When container authentication is in effect, this method is guaranteed to return the trustworthy user ID of the current request user. And if the user has not yet authenticated, it will return null.
 
Somak Dalui
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the explanation.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!