ldap連接配接錯誤類型:
INVALID_CREDENTIALS: 80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580
INVALID_CREDENTIALS: 80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 775, v1db1
Error code | Error | Description |
525 | User not found | Returned when an invalid username is supplied. |
52e | Invalid credentials | Returned when a valid username is supplied but an invalid password/credential is supplied. If this error is received, it will prevent most other errors from being displayed. |
530 | Not permitted to logon at this time | Returned when a valid username and password/credential are supplied during times when login is restricted. |
531 | Not permitted to logon from this workstation | Returned when a valid username and password/credential are supplied, but the user is restriced from using the workstation where the login was attempted. |
532 | Password expired | Returned when a valid username is supplied, and the supplied password is valid but expired. |
533 | Account disabled | Returned when a valid username and password/credential are supplied but the account has been disabled. |
701 | Account expired | Returned when a valid username and password/credential are supplied but the account has expired. |
773 | User must reset password | Returned when a valid username and password/credential are supplied, but the user must change their password immediately (before logging in for the first time, or after the password was reset by an administrator). |
775 | Account locked out | Returned when a valid username is supplied, but the account is locked out. Note that this error will be returned regardless of whether or not the password is invalid. |
catch (Exception ex)
{
string extendError =
((System.DirectoryServices.DirectoryServicesCOMException)(ex)).ExtendedErrorMessage;
if (extendError.Contains("data 773") || extendError.Contains("data 532"))
{
result = ADLoginResult.Success;
}
else
{
errMsg = ex.Message + "請聯系管理者!";
}
}
對上面的四種情況,得到的異常資訊如下:
//下次登入必須修改密碼 ,正确的密碼
8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 773, v1db1
//下次登入必須修改密碼 ,錯誤的密碼
8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 52e, v1db1
//密碼過期 ,正确的密碼
8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 532, v1db1
//密碼過期 ,錯誤的密碼
8009030C: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 52e, v1db1