Solved

get current user information

Posted on 2006-06-12
7
1,722 Views
Last Modified: 2007-12-19
hi guys,

i would like to get the current session user information from active directory by ldap in java.

thanks in advance...
0
Comment
Question by:ysnky
  • 3
7 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 16883672
You can get the current user-name using System.getProperty ( "user.name" ) ;

For LDAP, try this library: http://www.openldap.org/jldap/
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 125 total points
ID: 16883684
Any LDAP authentication routine typically contain two binds. The first bind should be as a service account (probably better not to use the directory-manager account) which does the search for the user's DN. The second bind actually binds as the user with the password given, so you don't need to compare anything. The directory simply returns authentication success or failure (the latter throws an AuthenticationException).
 
LDAP authentication tutorial - http://java.sun.com/products/jndi/tutorial/ldap/security/ldap.html
0
 

Assisted Solution

by:vpaturu
vpaturu earned 125 total points
ID: 16883933
0
 
LVL 9

Author Comment

by:ysnky
ID: 16885468
could you send me source code which list user fullname, email and display name...?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16886004
Its available on the link I posted.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
backtracking recursion  code 19 58
VB Script to add site to Java Exception List 4 76
more than one jdk and one jre 1 41
login jsp example 24 48
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question