participate


Naming and Directory (JNDI) - LDAP: error code 49 [Locked]
This topic is locked
<<   Back to Forum  |   Give us Feedback
10 Duke Stars rewarded for this thread
This topic has 13 replies on 1 page.
mpateck
Posts:11
Registered: 7/6/05
LDAP: error code 49   
Jan 30, 2006 4:16 AM

 
Hi,

i get this error code:
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09030F, comment: AcceptSecurityContext error, data 525, vece ]
And i have no idea why...

One month ago, the code worked fine. Nothing has changed (this means...the customer says, nothing has changed...)

The user is valid and active, the password is not expired. The certificate is also valid.
I tried the CN name and the lala@lala.de name.
What else can i check?

Thanks for your help!
 
adler_steven
Posts:668
Registered: 12/9/04
Re: LDAP: error code 49      
Jan 30, 2006 12:06 PM (reply 1 of 13)  (In reply to original post )

 
Hmmm....

You haven't been working in IT for very long.

When a customer says "nothing has changed" , assume they're lying.

The user name in your application is not valid.

Here is a list of Active Directory errors:
525 - user not found
52e - invalid credentials
530 - not permitted to logon at this time
532 - password expired
533 - account disabled
701 - account expired
773 - user must reset password

If the user is indeed valid and they can logon interactively, perhaps their userPrinciplaName (alberte@antipodes.com) or samAccountName (ANTIPODES\alberte) have not changed but their distinguished name has changed as a result of a rename or move operation. Eg. From cn=Albert Einstein, ou=Research,dc=antipodes,dc=com to cn=Albert Einstein,OU=Scientists,dc=antipodes,dc=com.

What format of the user logon name are you using in your application ?
 
mpateck
Posts:11
Registered: 7/6/05
Re: LDAP: error code 49   
Feb 2, 2006 8:02 AM (reply 2 of 13)  (In reply to #1 )

 
you are right!
the name has completely changed...
i asked the customer 23234234 times...lol
thanks!
 
Dave360
Posts:23
Registered: 5/11/06
Re: LDAP: error code 49   
May 11, 2006 6:26 PM (reply 3 of 13)  (In reply to #1 )

 
Just to add a little more to adler_steven's excellent info (including some of the info adler_steven posted on http://forum.java.sun.com/thread.jspa?forumID=51&threadID=658510), I include below a little more detail I "discovered" after experimenting with a Windows 2000 domain controller.

Common Active Directory LDAP bind errors:

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 525, v893
HEX: 0x525 - user not found
DEC: 1317 - ERROR_NO_SUCH_USER (The specified account does not exist.)
NOTE: Returns when username is invalid.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 52e, v893
HEX: 0x52e - invalid credentials
DEC: 1326 - ERROR_LOGON_FAILURE (Logon failure: unknown user name or bad password.)
NOTE: Returns when username is valid but password/credential is invalid. Will prevent most other errors from being displayed as noted.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 530, v893
HEX: 0x530 - not permitted to logon at this time
DEC: 1328 - ERROR_INVALID_LOGON_HOURS (Logon failure: account logon time restriction violation.)
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 531, v893
HEX: 0x531 - not permitted to logon from this workstation
DEC: 1329 - ERROR_INVALID_WORKSTATION (Logon failure: user not allowed to log on to this computer.)
LDAP[userWorkstations: <multivalued list of workstation names>]
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 532, v893
HEX: 0x532 - password expired
DEC: 1330 - ERROR_PASSWORD_EXPIRED (Logon failure: the specified account password has expired.)
LDAP[userAccountControl: <bitmask=0x00800000>] - PASSWORDEXPIRED
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 533, v893
HEX: 0x533 - account disabled
DEC: 1331 - ERROR_ACCOUNT_DISABLED (Logon failure: account currently disabled.)
LDAP[userAccountControl: <bitmask=0x00000002>] - ACCOUNTDISABLE
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 701, v893
HEX: 0x701 - account expired
DEC: 1793 - ERROR_ACCOUNT_EXPIRED (The user's account has expired.)
LDAP[accountExpires: <value of -1, 0, or extemely large value indicates account will not expire>] - ACCOUNTEXPIRED
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 773, v893
HEX: 0x773 - user must reset password
DEC: 1907 - ERROR_PASSWORD_MUST_CHANGE (The user's password must be changed before logging on the first time.)
LDAP[pwdLastSet: <value of 0 indicates admin-required password change>] - MUST_CHANGE_PASSWD
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 775, v893
HEX: 0x775 - account locked out
DEC: 1909 - ERROR_ACCOUNT_LOCKED_OUT (The referenced account is currently locked out and may not be logged on to.)
LDAP[userAccountControl: <bitmask=0x00000010>] - LOCKOUT
NOTE: Returns even if invalid password is presented.
 
Motiejus
Posts:1
Registered: 5/12/06
Re: LDAP: error code 49   
Jul 21, 2006 1:43 AM (reply 4 of 13)  (In reply to #1 )

 
I found out, that for some users the full user name (like "cn=Albert Einstein,OU=Scientists,dc=antipodes,dc=com")
should be provided, othervise you'll get 525 error message (unknown user).

For some user it works fine with short names...

looks like it is Active Directory configurtation.

It would be great to know what should be changed in Active Directory to get short user names working :))
 
adler_steven
Posts:668
Registered: 12/9/04
Re: LDAP: error code 49   
Jul 24, 2006 7:31 AM (reply 5 of 13)  (In reply to #4 )

 
Nothing is required in Active Directory to get short names to work.

If a short name does not appear to be working, check the user's samAccountName attribute to see if it is the same as what you are using in your code.

It is always possible that the user object was not created by the Active Directory Users & Computer's snap-in, but by another provisioning tool or by another application and the value may not be what you expect.

Also note that with Windows Server 2003, if the user is created but without a value specified for the samAccountName attribute (which btw is a mandatory attribute), then a random name will be generated automagically.
 
RHellem
Posts:6
Registered: 11/9/05
Re: LDAP: error code 49   
Nov 13, 2006 3:07 AM (reply 6 of 13)  (In reply to #5 )

 
It might also be caused by user rights in AD, without knowing how to set this up in AD I've noticed that my own user does not have the sufficient rights to perform a search in AD, but the bind user we use for our portal/app.server environment have the necessary rights.
 
HobNail
Posts:1
Registered: 2/1/07
Re: LDAP: error code 49   
Feb 1, 2007 5:20 PM (reply 7 of 13)  (In reply to #6 )

 
Hi

I got around this problem by using a tip I found elsewhere on the internet.

Replace the standard DN (eg cn=User Name,OU=Users,dc=richpeople,dc=com) with sAMAccountName@richpeople.com (where sAMAccountName is erm, well, the sAMAccountName for the user).
 
skio
Posts:4
Registered: 1/18/07
Re: LDAP: error code 49   
Feb 14, 2007 12:38 AM (reply 8 of 13)  (In reply to #3 )

 
While connecting to the AD i need to check whether the user exists, if his password id correct or not. In the catch block i am not able to match it against the error message
How to get the exact error message from the Exception?
 
tech_J
Posts:1
Registered: 6/10/08
Re: LDAP: error code 49   
Jun 10, 2008 3:20 AM (reply 9 of 13)  (In reply to #1 )

 
Hi
i'm trying to connect to an embedded LDAP server on weblogic.I'm just trying to connect to the server and do a directory search using

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(DirContext.PROVIDER_URL,"ldap://localhost:7001");
DirContext dc = new InitialDirContext(env);
SearchControls ctls = new SearchControls();
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
NamingEnumeration matchingEntries = dc.search("", "(objectclass=*)",ctls);

I'm able to connect to the embedded LDAP server through the ldap browser but not through the standalone java client code.
I'm getting [LDAP: error code 49 - Invalid Credentials]

Earlier it was connecting but now giving this error.

Thanks,
 
Saravanan4mTCS
Posts:4
Registered: 10/30/08
Re: LDAP: error code 49   
Oct 30, 2008 3:51 AM (reply 10 of 13)  (In reply to #1 )

 
Hi ,

I am also having the same issue.When the user was created initially it was working fine but when the user is deleted and then created then while I am checking for the SSO process with the ADS 2000 server I am getting the error

javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 52e, vece

Please suggest me some solution regarding the same as its very urgent .


Regards
Saravanan
 
fly99999
Posts:1
Registered: 7/22/09
Re: LDAP: error code 49   
Jul 22, 2009 8:50 PM (reply 11 of 13)  (In reply to #1 )

 
hello :
I am from China, I see your blog ,but I don't know about DN info ' cn ,ou ,o,c' mean
Can you tel me? Thank you! my email is: lijianan789@163.com
for example:
//****************Please modify the following three properties accordingly ***********
String ldapHost= "ldap://cliang1.austin.ibm.com:389"; //ldap host + port number
String DN = "cn=user1, ou=Austin,o=ibm,c=us"; // DN to be authenticated
String password = "security"; // DN's password
//*************** End of user information
 
BIJ001
Posts:6,896
Registered: 2003.06.06.
Re: LDAP: error code 49   
Jul 23, 2009 3:05 AM (reply 12 of 13)  (In reply to #10 )

 
Thank you! my email is:

It is not a good idea to post your e-mail address on a public forum. Spammers might harvest it.
And things should be discussed here not in private correspondance anyway.
 
PhHein
Posts:10,701
Registered: 8/16/01
Re: LDAP: error code 49   
Aug 5, 2009 4:46 AM (reply 13 of 13)  (In reply to #11 )

 
Welcome to the forum fly99999. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.

I'm locking this thread now.
 
This topic has 13 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 24
  • Guests : 134

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums