0

I have one question, i'm trying to to authenticate to AD via LDAP, and when i put invalid credentials i got exception message like this: LDAPException(resultCode=49 (invalid credentials), errorMessage='80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db0, and this is ok, but more exact reason of this exception is in part"data 52e", and it tell's me "invalid credentials ". When credentials are good but for example "password expired" in exception message i will get "data 532". This part of message can have different values depending of exception reason (533-account disabled, 701-account expired etc.). My problem is how to catch only this part of exception message. I want to handle the exception according to this error code. Fore example :

switch(err_code){
case 52e:
System.out.println("invalid credentials");
break;
case "530,":
System.out.println("not permitted to logon at this time");
break;
}

But I don't want to use regular expresions to match error code. Any ideas?

1
  • Check the contents of the diagnostic message using LDAPException#getDiagnosticMessage() Commented Oct 4, 2013 at 9:37

1 Answer 1

0

These codes are probably specific to Active Directory implementation. Have a look at the explanation to the similar question.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.