Register / Login
Win a copy of
Learn Spring Security (video course)
this week in the
Getting javax.naming.AuthenticationException while connecting to LDAP server from java code
posted 4 years ago
I am trying to connnect to LDAP server from our webapp. The webapp requests the Data from LDAP server by passing the Directorty Server account/access information.
code when I try to create the
by passing the environment and control
My java code looks like this:
ctx = new
"env" is just a HashTable with the following data that it sets based on what user enters on UI
As soon as it try to create a
in java code, it throws a
: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db0
I digged little bit details into it. It means invalid credentials; user name or password is incorrect.
But, I can directly login/connect/bind/search to the ldap server from command prompt using ldap.exe utility with the same information.
connect to server: 192.168.72.4:389
Here is what I see in LDAP server by doing a serach using the LDAP utility:
distinguished Name:CN=Sudipti Mishra,OU=Ops,DC=GreyHawk,DC=tonecommander,DC=com
I am not sure why keep on getting this error when I try to login using the Java code. Am I missing something?
Any help is greatly appreciated.
Connecting to Active Directory using LDAP
Program to validate a user against LDAP
Autenticate from java into Windows Active Directory
servlet querying active directory
LDAP on websphere app server 7 problem