Link to home
Start Free TrialLog in
Avatar of jinduy
jinduy

asked on

LDAP authentication through JSP and some basic LDAP question...

I can't seem to find a topic related to LDAP so I'm posting here since I am planning to use jsp to interact with the ldap server. My LDAP server consists of a bunch of entries of users and passwords... so for each entry it's like:

dn: uid=neo,o=usa
uid: neo
userPassword: biao
o=usa

Problem #1: I added an entry like this into my database. When I did a search to output this entry, i got something like:

# neo, rcms2
dn: uid=neo,o=rcms2
objectClass: uidObject
objectClass: simpleSecurityObject
objectClass: organization
uid: neo
o: rcms2
userPassword:: Ymlhbw==

Notice how the password has become encryped? How am I supposed to extract the real password through the search query without having it be encryped?

Also, how would jsp interact with my ldap server with the databse setup like the above example? Any hints or web sites or code would be nice. I tried googling but they were pretty rough and tough for me to comprehend =(. I'm pretty new at this, let alone java.
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kokchoon78
kokchoon78

try this url, some sample code available :

http://www.octetstring.com/products/jdbcldapdriver/
yeah i tried setting hte passwored to a new one, and it got encryped to a different string!

the reason i'd like to know how to extract a password is because, how would i be able to authenticate a user through jsp if i can't compare a user's login (id/password) input to the entry in a databaW028since it's all encrypted)?
to clarify i tried modifying the encrypted password doing something like

...modify command...
dn: uid=neo,o=rcms2
userPassword: swordfish

and the swordfish is encrypted yet again when i enter a query. i'm starting to guess now that maybe there's a java-based driver that can do all this dirty work for me?
Read up on JNDI.  I think you can get something there about connecting to LDAP
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Looks like a multi to me:

jinduy asks the question, then lapchern seems to take over...

*sigh*

:)
Hello Tim, long time no see :)

So you mean multi-accounts or split the points?
Hiya!  Hope you're keeping well!! :)  

Yeah...too busy at work :-(  I'm having a 10 minute skiive ;-)  hee hee

I meant Multiple accounts...  

jinduy == lapchern ?

:-/
You are probably right. I think I will ask a moderator to take a look at that :)
I will yes. I will go through all the questions again today to do a final cleanup :)
roman_gagarskiy might have hit the nail on the head...

maybe ;)