Beispiel #1
0
        private void HandleKerberosError(KerberosErrorException ex, string username)
        {
            KRB_ERROR krbError = ex.krbError;

            switch ((Interop.KERBEROS_ERROR)krbError.error_code)
            {
            case Interop.KERBEROS_ERROR.KDC_ERR_PREAUTH_FAILED:
                this.ReportValidUser(username);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_C_PRINCIPAL_UNKNOWN:
                this.ReportInvalidUser(username);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_CLIENT_REVOKED:
                this.ReportBlockedUser(username);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_ETYPE_NOTSUPP:
                this.ReportInvalidEncryptionType(username, krbError);
                break;

            default:
                this.ReportKrbError(username, krbError);
                throw ex;
            }
        }
Beispiel #2
0
        private bool HandleKerberosError(KerberosErrorException ex, string username, string password)
        {
            KRB_ERROR krbError = ex.krbError;
            bool      ret      = false;

            switch ((Interop.KERBEROS_ERROR)krbError.error_code)
            {
            case Interop.KERBEROS_ERROR.KDC_ERR_PREAUTH_FAILED:
                this.ReportValidUser(username);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_C_PRINCIPAL_UNKNOWN:
                this.ReportInvalidUser(username);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_CLIENT_REVOKED:
                this.ReportBlockedUser(username);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_ETYPE_NOTSUPP:
                this.ReportInvalidEncryptionType(username, krbError);
                break;

            case Interop.KERBEROS_ERROR.KDC_ERR_KEY_EXPIRED:
                this.ReportValidPassword(username, password, null, (Interop.KERBEROS_ERROR)krbError.error_code);
                ret = true;
                break;

            default:
                this.ReportKrbError(username, krbError);
                throw ex;
            }
            return(ret);
        }