Search in sources :

Example 1 with InboundResponseFromCountry

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

the class EidasSessionResourceIntegrationTest method stubSamlEngineTranslationLOAForCountry.

private void stubSamlEngineTranslationLOAForCountry(LevelOfAssurance loa, EidasCountryDto country) throws Exception {
    samlEngineStub.reset();
    translationDto = new InboundResponseFromCountry(IdpIdaStatus.Status.Success, Optional.absent(), country.getEntityId(), Optional.of("BLOB"), Optional.of("PID"), Optional.of(loa));
    samlEngineStub.setupStubForCountryAuthnResponseTranslate(translationDto);
}
Also used : InboundResponseFromCountry(uk.gov.ida.hub.policy.domain.InboundResponseFromCountry)

Example 2 with InboundResponseFromCountry

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

the class EidasSessionResourceIntegrationTest method stubSamlEngineTranslationToFailForCountry.

private void stubSamlEngineTranslationToFailForCountry(EidasCountryDto country) throws Exception {
    samlEngineStub.reset();
    translationDto = new InboundResponseFromCountry(IdpIdaStatus.Status.RequesterError, Optional.absent(), country.getEntityId(), Optional.absent(), Optional.absent(), Optional.absent());
    samlEngineStub.setupStubForCountryAuthnResponseTranslate(translationDto);
}
Also used : InboundResponseFromCountry(uk.gov.ida.hub.policy.domain.InboundResponseFromCountry)

Example 3 with InboundResponseFromCountry

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

the class EidasMatchingServiceResourceIntegrationTest method stubSamlEngineTranslationLOAForCountry.

private void stubSamlEngineTranslationLOAForCountry(final LevelOfAssurance loa, final EidasCountryDto country) throws Exception {
    samlEngineStub.reset();
    InboundResponseFromCountry translationDto = new InboundResponseFromCountry(IdpIdaStatus.Status.Success, Optional.absent(), country.getEntityId(), Optional.of("BLOB"), Optional.of("PID"), Optional.of(loa));
    samlEngineStub.setupStubForCountryAuthnResponseTranslate(translationDto);
}
Also used : InboundResponseFromCountry(uk.gov.ida.hub.policy.domain.InboundResponseFromCountry)

Example 4 with InboundResponseFromCountry

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

the class AuthnResponseFromCountryService method receiveAuthnResponseFromCountry.

public ResponseAction receiveAuthnResponseFromCountry(SessionId sessionId, SamlAuthnResponseContainerDto responseFromCountry) {
    CountrySelectedStateController stateController = (CountrySelectedStateController) sessionRepository.getStateController(sessionId, CountrySelectedState.class);
    String matchingServiceEntityId = stateController.getMatchingServiceEntityId();
    stateController.validateCountryIsIn(countriesService.getCountries(sessionId));
    SamlAuthnResponseTranslatorDto responseToTranslate = samlAuthnResponseTranslatorDtoFactory.fromSamlAuthnResponseContainerDto(responseFromCountry, matchingServiceEntityId);
    InboundResponseFromCountry translatedResponse = samlEngineProxy.translateAuthnResponseFromCountry(responseToTranslate);
    if (translatedResponse.getStatus() != IdpIdaStatus.Status.Success)
        return other(sessionId, false);
    validateSuccessfulResponse(stateController, translatedResponse);
    EidasAttributeQueryRequestDto eidasAttributeQueryRequestDto = getEidasAttributeQueryRequestDto(stateController, translatedResponse);
    stateController.transitionToEidasCycle0And1MatchRequestSentState(eidasAttributeQueryRequestDto, responseFromCountry.getPrincipalIPAddressAsSeenByHub(), translatedResponse.getIssuer());
    AttributeQueryContainerDto aqr = samlEngineProxy.generateEidasAttributeQuery(eidasAttributeQueryRequestDto);
    samlSoapProxyProxy.sendHubMatchingServiceRequest(sessionId, getAttributeQueryRequest(aqr));
    return ResponseAction.success(sessionId, false, LevelOfAssurance.LEVEL_2);
}
Also used : AttributeQueryContainerDto(uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto) InboundResponseFromCountry(uk.gov.ida.hub.policy.domain.InboundResponseFromCountry) SamlAuthnResponseTranslatorDto(uk.gov.ida.hub.policy.contracts.SamlAuthnResponseTranslatorDto) CountrySelectedState(uk.gov.ida.hub.policy.domain.state.CountrySelectedState) CountrySelectedStateController(uk.gov.ida.hub.policy.domain.controller.CountrySelectedStateController) EidasAttributeQueryRequestDto(uk.gov.ida.hub.policy.contracts.EidasAttributeQueryRequestDto)

Aggregations

InboundResponseFromCountry (uk.gov.ida.hub.policy.domain.InboundResponseFromCountry)4 AttributeQueryContainerDto (uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto)1 EidasAttributeQueryRequestDto (uk.gov.ida.hub.policy.contracts.EidasAttributeQueryRequestDto)1 SamlAuthnResponseTranslatorDto (uk.gov.ida.hub.policy.contracts.SamlAuthnResponseTranslatorDto)1 CountrySelectedStateController (uk.gov.ida.hub.policy.domain.controller.CountrySelectedStateController)1 CountrySelectedState (uk.gov.ida.hub.policy.domain.state.CountrySelectedState)1