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);
}
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);
}
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);
}
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);
}
Aggregations