Esempio n. 1
0
        private void Fetch_throws_on_invalid_username_or_password()
        {
            var rest = new RestFlow().Post("{'objectType': 'message', 'content': 'Incorrect authentification'}");

            Exceptions.AssertThrowsBadMultiFactor(() => Remote.Fetch(Username, Uki, rest),
                                                  "Invalid email token");
        }
Esempio n. 2
0
        public void GetEncryptedToken_throws_BadMultiFactorException_on_4003_status()
        {
            var flow = new RestFlow().Post(ResponseWithError4003);

            Exceptions.AssertThrowsBadMultiFactor(
                () => Client.GetEncryptedToken(Username, DeviceId, EmailPasscode, Timestamp, flow),
                "Second factor code is not correct");
        }
        public void OpenVault_throws_on_failed_oob()
        {
            var flow = new RestFlow()
                       .Post(OobRequiredResponse)
                       .Post("<response><error cause='multifactorresponsefailed' /></response>");

            Exceptions.AssertThrowsBadMultiFactor(
                () => Client.OpenVault(Username, Password, ClientInfo, WaitingForOobUi, flow),
                "Out of band authentication failed");
        }
        public void OpenVault_throws_on_failed_otp()
        {
            var flow = new RestFlow()
                       .Post(OtpRequiredResponse)
                       .Post("<response><error cause='googleauthfailed' /></response>");

            Exceptions.AssertThrowsBadMultiFactor(
                () => Client.OpenVault(Username, Password, ClientInfo, OtpProvidingUi, flow),
                "Second factor code is incorrect");
        }
Esempio n. 5
0
        public void OpenVaultDb_throws_BadMultiFactorException_on_incorrect_passcode()
        {
            var flow = new RestFlow()
                       .Post(ResponseWithError4002)
                       .Post(ResponseWithError4003);

            Exceptions.AssertThrowsBadMultiFactor(
                () => Client.OpenVaultDb(Username, Password, DeviceId, DeviceName, GetPasscodeProvidingUi(), flow),
                "Second factor code is not correct");
        }
        public void SubmitSecondFactorCode_throws_BadMultiFactor_on_auth_error()
        {
            var flow = new RestFlow().Post(EncryptFixture("no-auth-response"));

            Exceptions.AssertThrowsBadMultiFactor(
                () => Client.SubmitSecondFactorCode(Client.SecondFactorKind.GoogleAuthenticator,
                                                    "123456",
                                                    TestData.SessionKey,
                                                    flow),
                "Incorrect second factor code");
        }