ArtinSoft's Blogs

Software Migration Experts
Welcome to ArtinSoft's Blogs Sign in | Join | Help
in Search

Mauricio Rojas Blog

Active Directory, Password Expired

There are a list of situations you might want to handle with Active Directory:

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

 
This is an extract of the Java Forum to handle these cases. Good Luck!
 
} catch (AuthenticationException e) {
String tempString;
StringTokenizer tokenizerTemp = new StringTokenizer(e.toString());
while (tokenizerTemp.hasMoreElements()) {
         tempString = tokenizerTemp.nextToken();
         if (tempString.equalsIgnoreCase("AcceptSecurityContext")) {
                 while (tokenizerTemp.hasMoreElements()) {
                          tempString = tokenizerTemp.nextToken();
                          if (tempString.startsWith("773"))
                                   setIsPasswordExpired(true);
                          if (tempString.startsWith("52e"))
                                   setIsPasswordWrong(true);
                          if (tempString.startsWith("533"))
                                   setIsAccountDisabled(true);
                 }
         }
}
throw new NamingException();
}

 

 

Published May 14 2007, 01:46 PM by Mrojas
Filed under:

Comments

No Comments
Powered by Community Server (Non-Commercial Edition), by Telligent Systems