aspose file tools*
The moose likes Security and the fly likes LDAP username password retrival Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "LDAP username password retrival" Watch "LDAP username password retrival" New topic
Author

LDAP username password retrival

Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 136
Hi,

I want to retrieve the username and password frtom LDAP server for the respective userId which is passed as an input. I am using javax.naming security package in java (1.6). Please help me how we can go about this? any examples or links are really appreciated.

Thanks.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4366
    
    8

You shouldn't be able to extract the password. It should be stored using a hash function/one-way encryption so that you can check a password but not recover it.
Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 136
Thanks Mathew. Password will always be encrypted and stored in the LDAP DB right? Where my requirement is to retrieve the encrypted password and store that in a local DB?How to go about this? Whether LDAP server will have any table where the username & password will be stored? Please clarify.

Thanks.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4366
    
    8

It's going to depend on your LDAP server, and how it stores the password. But it's very common to use a one-way encryption, as I said. If that's the case then what you want to do simply isn't possible (short of running a brute force attack against every password).

You'll have to check the documentation and configuration for your specific server - maybe ask your system administrators.
Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 138

I am not 100% sure if this is possible, but something that I remember from one of my previous projects.

LDAP can add logged in user's attributes to http header.

Again, I don't know if this would depend on LDAP server implementation or so.

A link that might help you :
http://pic.dhe.ibm.com/infocenter/tivihelp/v2r1/index.jsp?topic=%2Fcom.ibm.itame2.doc_5.1%2Fam51_webservers_guide145.htm


Regards,
Prajakta
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: LDAP username password retrival