active directory - DirectoryServicesCOMException.ExtendedErrorMessage - List of Data Codes -
i building website let's users log in active directory accounts, , want inform user why login failed.
the background
logins fail due bad username/password, can fail due expired password or account being locked out.
i using this code perform login:
public mycustomuserclass login(string domainname, string username, string password) { string domainandusername = domainname + @"\" + username; directoryentry entry = new directoryentry(this._ldappath, domainandusername, password); mycustomuserclass user = new mycustomuserclass(); //bind native adsobject force authentication. try { object obj = entry.nativeobject; // ... return user; } catch (directoryservicescomexception ex) { // why did login fail? } catch (exception ex) { // else went wrong } }
when receive directoryservicescomexception
, can access more information failed login attempt within .extendederrormessage
property. 2 values have seen far are:
lockout:
8009030c: ldaperr: dsid-0c0904dc, comment: acceptsecuritycontext error, data 775, v1db1
bad username:
8009030c: ldaperr: dsid-0c0904dc, comment: acceptsecuritycontext error, data 52e, v1db1
you can see data
"attribute" seems unique. can write code extracts it, write switch based off of this.
the question
is there list of these codes anywhere can use make sure i'm covering everything?
after day of searching microsoft resources regarding directoryservicescomexception.extendederrormessage
, found differently-worded question here:
it references website found here includes several such codes:
http://www-01.ibm.com/support/docview.wss?uid=swg21290631
below list of error codes:
525 - user not found 52e - invalid credentials 530 - not permitted logon @ time 531 - not permitted logon @ workstation 532 - password expired 533 - account disabled 534 - user has not been granted requested logon type @ machine 701 - account expired 773 - user must reset password 775 - user account locked
Comments
Post a Comment