This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Security and the fly likes how to retrive attribute from ldap structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "how to retrive attribute from ldap structure" Watch "how to retrive attribute from ldap structure" New topic
Author

how to retrive attribute from ldap structure

Rahul Bhalla
Greenhorn

Joined: Jan 28, 2012
Posts: 17
Hi every one
i am creating a login page in user enter there id and password so that he or she get authenticate
which is done by using

but now i want to retrive user name and title from ldap but how can i do that because i am not aware of LDAP structure or attribute
Hope for the reply
Thanks
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi Rahul,

Well you need at last a valid connection to lookup what's is the ldap schema or a ldif file.
You cannot simply guess what is the ldap schema.


Best regards,

Rahul Bhalla
Greenhorn

Joined: Jan 28, 2012
Posts: 17
Hi Carles Gasques
First of thnks for the reply
I have valid connection through which i am able login but donot know to reach cn="user" and in that i have to find out for title of that user
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi Rahul,

If you are using Eclipse IDE install the Apache Directory Studio plugin.
Once configured the ldap connection you could see a view with the ldap nodes tree and navigate the schema.
With this info. will be easy to complete your ldap code.


Best regards,
Rahul Bhalla
Greenhorn

Joined: Jan 28, 2012
Posts: 17
Hi Carles Gasques
Thank you for the so quick suggestion
my schema looks like this

As i authenticate the login page with help of hiven

i am able to get the value of title using below statement

but i want to that just i login through the mail id and get value of the title
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi,

You have to perform a search for the mail (mail=rahulbhalla@domainName.net)



Where your base dn is probably "CN=Users,DC=domainName,DC=net"


Best regards,
Rahul Bhalla
Greenhorn

Joined: Jan 28, 2012
Posts: 17
hello
Thanks for help me Carles Gasques and coderanch
I need one more help from you (Carles Gasques)
Is it possible to provide me a good source (which you strongly recommend )to learn LDAP
Thanks once give
Bijoy Joseph
Greenhorn

Joined: May 22, 2013
Posts: 4
This JNDI tutorial gives a number of examples using LDAP.The directory service examples referenced there are using LDAP .
http://www.coderpanda.com/jndi-tutorial/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retrive attribute from ldap structure
 
Similar Threads
How to configure LDAP in JBoss AS 7.1.1
how to retrive attribute from ldap structure
Connecting to LDAP server over SSL without using certificates
hi
LDAP Context properties and LDAP authentication.