示例#1
0
        public void Post_throws_bad_password_on_unauthorized()
        {
            var flow = new RestFlow().Post("", HttpStatusCode.Unauthorized);

            Exceptions.AssertThrowsBadCredentials(
                () => Client.Post(flow, "endpoint", DeviceId, Timestamp, RestClient.NoParameters),
                "The password is incorrect");
        }
 public void Decrypt_throws_on_incorrect_encryption_key()
 {
     Exceptions.AssertThrowsBadCredentials(() => Parse.Decrypt(
                                               "TZ1+if9ofqRKTatyUaOnfudletslMJ/RZyUwJuR/+aI=".Decode64(),
                                               "YFuiAVZgOD2K+s6y8yaMOw==".Decode64(),
                                               "Incorrect key must be 32 bytes!!".ToBytes()),
                                           "The password is incorrect");
 }
        public void VerifySessionKey_throws_BadCredentials_on_auth_error()
        {
            var flow = new RestFlow().Post(EncryptFixture("no-auth-response"));

            Exceptions.AssertThrowsBadCredentials(
                () => Client.VerifySessionKey(TestData.ClientInfo, TestData.SessionKey, flow),
                "Username, password or account key");
        }
示例#4
0
        public void GetEncryptedToken_throws_BadCredentialsException_on_1006_status()
        {
            var flow = new RestFlow().Post(ResponseWithError1006);

            Exceptions.AssertThrowsBadCredentials(
                () => Client.GetEncryptedToken(Username, DeviceId, NoPasscode, Timestamp, flow),
                "Invalid username");
        }
        public void OpenVault_throws_on_invalid_password()
        {
            var flow = new RestFlow()
                       .Post("<response><error cause='unknownpassword' /></response>");

            Exceptions.AssertThrowsBadCredentials(
                () => Client.OpenVault(Username, Password, ClientInfo, null, flow),
                "Invalid password");
        }
示例#6
0
        public void Step2_throws_on_HTTP_unuthorized()
        {
            var rest = new RestFlow()
                       .Post("", HttpStatusCode.Unauthorized);

            Exceptions.AssertThrowsBadCredentials(
                () => Client.Step2(TestData.Credentials, new Client.OtpOptions(), TestData.AuthInfo, rest),
                "Invalid username or password");
        }
        public void Authenticate_throws_on_incorrect_passphrase()
        {
            var flow = new RestFlow()
                       .Get(GetFixture("auth-info-response"));

            Exceptions.AssertThrowsBadCredentials(
                () => Client.Authenticate("Not really a passphrase", LoginCookies, "com", flow),
                "Passphrase is incorrect");
        }
        public void LogIn_throws_in_incorrect_password()
        {
            var flow = new RestFlow()
                       .Post(GetFixture("login-incorrect-password-response"));

            Exceptions.AssertThrowsBadCredentials(
                () => Client.LogIn(UserInfo, Password, OAuthCookieValue, null, GetSecureStorage(), flow),
                "The password is incorrect");
        }
        public void RequestUserInfo_throws_on_unknown_user()
        {
            var flow = new RestFlow()
                       .Post(GetFixture("lookup-no-user-response"));

            Exceptions.AssertThrowsBadCredentials(
                () => Client.RequestUserInfo("unknown", OAuthCookieValue, "com", flow),
                "The username is invalid");
        }
        public void Login_throws_on_invalid_credentials()
        {
            var flow = new RestFlow()
                       .Post("{'Status':'', 'LogonContext': 'blah'}")
                       .Post("{'Status': 'InvalidRegistrationData'}", HttpStatusCode.Unauthorized);

            Exceptions.AssertThrowsBadCredentials(() => Client.Login("username", "password", flow),
                                                  "username or password is incorrect");
        }
        public void OpenVault_throws_on_invalid_username()
        {
            var flow = new RestFlow()
                       .Post(KeyIterationCount.ToString())
                       .Post("<response><error cause='unknownemail' /></response>");

            Exceptions.AssertThrowsBadCredentials(
                () => Client.OpenVault(Username, Password, ClientInfo, null, flow),
                "Invalid username");
        }
示例#12
0
        public void LoginCliApi_throws_on_incorrect_client_credentials()
        {
            var rest = new RestFlow()
                       .Post("{'error':'invalid_client'}", status: HttpStatusCode.BadRequest)
                       .ExpectUrl("/identity/connect/token");

            Exceptions.AssertThrowsBadCredentials(
                () => Client.LoginCliApi(ClientId, ClientSecret, DeviceId, rest),
                "Client ID or secret is incorrect");
        }
 public void DecryptBlob_throws_on_incorrect_password()
 {
     Exceptions.AssertThrowsBadCredentials(() => Parse.DecryptBlob(Blob, "Incorrect password"),
                                           "The password is incorrect");
 }
 public void LoadSettingsFile_throws_on_incorrect_key()
 {
     Exceptions.AssertThrowsBadCredentials(
         () => Import.LoadSettingsFile(SettingsFilename, "Incorrect key".ToBytes()),
         "The password is incorrect");
 }
 public void ImportLocalKey_throws_on_incorrect_password()
 {
     Exceptions.AssertThrowsBadCredentials(
         () => Import.ImportLocalKey($"{FixtureDir}/localKey-kwc3.aes", "Incorrect password"),
         "The password is incorrect");
 }