Search in sources :

Example 11 with AuthenticationErrorResponse

use of uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse in project verify-hub by alphagov.

the class IdpSelectedStateControllerTest method handleNoAuthenticationContextResponseFromIdp_shouldTransitionToSessionCreatedStateWhenSigninCancelled.

@Test
public void handleNoAuthenticationContextResponseFromIdp_shouldTransitionToSessionCreatedStateWhenSigninCancelled() {
    AuthenticationErrorResponse authenticationErrorResponse = anAuthenticationErrorResponse().withIssuerId(IDP_ENTITY_ID).build();
    when(identityProvidersConfigProxy.getEnabledIdentityProviders(any(String.class), eq(controller.isRegistrationContext()), eq(PROVIDED_LOA))).thenReturn(singletonList(authenticationErrorResponse.getIssuer()));
    controller.handleNoAuthenticationContextResponseFromIdp(authenticationErrorResponse);
    verify(stateTransitionAction).transitionTo(isA(SessionStartedState.class));
}
Also used : AuthenticationErrorResponse(uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse) AuthenticationErrorResponseBuilder.anAuthenticationErrorResponse(uk.gov.ida.hub.policy.builder.domain.AuthenticationErrorResponseBuilder.anAuthenticationErrorResponse) SessionStartedState(uk.gov.ida.hub.policy.domain.state.SessionStartedState) Test(org.junit.Test)

Example 12 with AuthenticationErrorResponse

use of uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse in project verify-hub by alphagov.

the class AuthnResponseFromIdpService method handleAuthnFailedResponse.

private ResponseAction handleAuthnFailedResponse(InboundResponseFromIdpDto idaResponseFromIdp, SessionId sessionId, String principalIPAddressAsSeenByHub, IdpSelectedStateController idpSelectedStateController) {
    AuthenticationErrorResponse authenticationErrorResponse = new AuthenticationErrorResponse(idaResponseFromIdp.getIssuer(), principalIPAddressAsSeenByHub);
    idpSelectedStateController.handleAuthenticationFailedResponseFromIdp(authenticationErrorResponse);
    return other(sessionId, idpSelectedStateController.isRegistrationContext());
}
Also used : AuthenticationErrorResponse(uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse)

Example 13 with AuthenticationErrorResponse

use of uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse in project verify-hub by alphagov.

the class AuthnResponseFromIdpService method handleUpliftFailed.

private ResponseAction handleUpliftFailed(InboundResponseFromIdpDto inboundResponseFromIdpDto, SessionId sessionId, String principalIPAddressAsSeenByHub, IdpSelectedStateController idpSelectedController) {
    AuthenticationErrorResponse noAuthenticationContextErrorResponse = new AuthenticationErrorResponse(inboundResponseFromIdpDto.getIssuer(), principalIPAddressAsSeenByHub);
    idpSelectedController.handleNoAuthenticationContextResponseFromIdp(noAuthenticationContextErrorResponse);
    return failedUplift(sessionId, idpSelectedController.isRegistrationContext());
}
Also used : AuthenticationErrorResponse(uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse)

Aggregations

AuthenticationErrorResponse (uk.gov.ida.hub.policy.domain.AuthenticationErrorResponse)13 AuthenticationErrorResponseBuilder.anAuthenticationErrorResponse (uk.gov.ida.hub.policy.builder.domain.AuthenticationErrorResponseBuilder.anAuthenticationErrorResponse)9 Test (org.junit.Test)7 AuthnFailedErrorState (uk.gov.ida.hub.policy.domain.state.AuthnFailedErrorState)2 SessionStartedState (uk.gov.ida.hub.policy.domain.state.SessionStartedState)2 IdpSelectedStateBuilder.anIdpSelectedState (uk.gov.ida.hub.policy.builder.state.IdpSelectedStateBuilder.anIdpSelectedState)1 State (uk.gov.ida.hub.policy.domain.State)1 Cycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.domain.state.Cycle0And1MatchRequestSentState)1 FraudEventDetectedState (uk.gov.ida.hub.policy.domain.state.FraudEventDetectedState)1 IdpSelectedState (uk.gov.ida.hub.policy.domain.state.IdpSelectedState)1 PausedRegistrationState (uk.gov.ida.hub.policy.domain.state.PausedRegistrationState)1