public void CreateDefaultWithSsnTest()
        {
            InitiateAuthenticationRequest expectedInitiateAuthenticationRequest = new InitiateAuthenticationRequest(UserInfoType.SSN, UserInfoUtil.ConvertSsnUserInfo(SSN_USER_INFO), MinRegistrationLevel.BASIC, null, null);
            InitiateAuthenticationRequest initiateAuthenticationRequest         = InitiateAuthenticationRequest.CreateDefaultWithSsn(SSN_USER_INFO);

            AssertRequestsAreEqual(expectedInitiateAuthenticationRequest, initiateAuthenticationRequest);
        }
        public void UserInfoTypeSsn_success()
        {
            InitiateAuthenticationRequest initiateAuthenticationRequest = InitiateAuthenticationRequest.CreateDefaultWithSsn(SsnUserInfo.Create(CommonTestData.COUNTRY, CommonTestData.SSN));

            RelyingPartyNull_success(initiateAuthenticationRequest);
        }
Esempio n. 3
0
        public void InitAuth_success()
        {
            String initAuthResponseString = jsonService.SerializeToJson(initiateAuthenticationResponse);

            InitiateAuthenticationRequest initiateAuthenticationRequestDefaultWithEmail = InitiateAuthenticationRequest.CreateDefaultWithEmail(EMAIL);

            SendInitAuthRequestAndAssertResponse(initiateAuthenticationRequestDefaultWithEmail, initAuthResponseString);

            InitiateAuthenticationRequest initiateAuthenticationRequestDefaultWithSsn = InitiateAuthenticationRequest.CreateDefaultWithSsn(SsnUserInfo.Create(Country.NORWAY, SSN));

            SendInitAuthRequestAndAssertResponse(initiateAuthenticationRequestDefaultWithSsn, initAuthResponseString);

            InitiateAuthenticationRequest initAuthenticationRequestWithRequestedAttributesUserInfoEmail = InitiateAuthenticationRequest.CreateCustom()
                                                                                                          .SetEmail(EMAIL)
                                                                                                          .SetAttributesToReturn(AttributeToReturn.BASIC_USER_INFO, AttributeToReturn.EMAIL_ADDRESS, AttributeToReturn.SSN, AttributeToReturn.CUSTOM_IDENTIFIER, AttributeToReturn.INTEGRATOR_SPECIFIC_USER_ID)
                                                                                                          .Build();

            SendInitAuthRequestAndAssertResponse(initAuthenticationRequestWithRequestedAttributesUserInfoEmail, initAuthResponseString);

            InitiateAuthenticationRequest initAuthenticationRequestWithRequestedAttributesUserInfoPhoneNum = InitiateAuthenticationRequest.CreateCustom()
                                                                                                             .SetPhoneNumber(EMAIL)
                                                                                                             .SetAttributesToReturn(AttributeToReturn.BASIC_USER_INFO, AttributeToReturn.EMAIL_ADDRESS, AttributeToReturn.SSN, AttributeToReturn.CUSTOM_IDENTIFIER, AttributeToReturn.INTEGRATOR_SPECIFIC_USER_ID)
                                                                                                             .Build();

            SendInitAuthRequestAndAssertResponse(initAuthenticationRequestWithRequestedAttributesUserInfoPhoneNum, initAuthResponseString);

            InitiateAuthenticationRequest initAuthenticationRequestWithRequestedAttributesUserInfoSsn = InitiateAuthenticationRequest.CreateCustom()
                                                                                                        .SetSsn(SsnUserInfo.Create(Country.NORWAY, SSN))
                                                                                                        .SetAttributesToReturn(AttributeToReturn.BASIC_USER_INFO, AttributeToReturn.EMAIL_ADDRESS, AttributeToReturn.SSN, AttributeToReturn.CUSTOM_IDENTIFIER, AttributeToReturn.INTEGRATOR_SPECIFIC_USER_ID)
                                                                                                        .Build();

            SendInitAuthRequestAndAssertResponse(initAuthenticationRequestWithRequestedAttributesUserInfoSsn, initAuthResponseString);

            InitiateAuthenticationRequest initAuthenticationRequestWithRequestedAttributesUserInfoInferred = InitiateAuthenticationRequest.CreateCustom()
                                                                                                             .SetInferred()
                                                                                                             .SetAttributesToReturn(AttributeToReturn.BASIC_USER_INFO, AttributeToReturn.EMAIL_ADDRESS, AttributeToReturn.SSN, AttributeToReturn.CUSTOM_IDENTIFIER, AttributeToReturn.INTEGRATOR_SPECIFIC_USER_ID)
                                                                                                             .Build();

            SendInitAuthRequestAndAssertResponse(initAuthenticationRequestWithRequestedAttributesUserInfoInferred, initAuthResponseString);

            InitiateAuthenticationRequest initAuthenticationRequestWithRegistrationStateAndRelyingPartyId = InitiateAuthenticationRequest.CreateCustom()
                                                                                                            .SetEmail(EMAIL)
                                                                                                            .SetMinRegistrationLevel(MinRegistrationLevel.EXTENDED)
                                                                                                            .SetRelyingPartyId(RELYING_PARTY_ID)
                                                                                                            .Build();
            InitiateAuthenticationRequest expectedInitAuthenticationRequestWithRegistrationStateAndRelyingPartyId = InitiateAuthenticationRequest.CreateCustom()
                                                                                                                    .SetEmail(EMAIL)
                                                                                                                    .SetMinRegistrationLevel(MinRegistrationLevel.EXTENDED)
                                                                                                                    .Build();

            SendInitAuthRequestAndAssertResponse(expectedInitAuthenticationRequestWithRegistrationStateAndRelyingPartyId, initAuthenticationRequestWithRegistrationStateAndRelyingPartyId, initAuthResponseString);
        }