This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.
Joined: Jan 24, 2011
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.
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.