Search in sources :

Example 1 with SamlResponseContainerDto

use of uk.gov.ida.hub.policy.contracts.SamlResponseContainerDto in project verify-hub by alphagov.

the class MatchingServiceResponseService method handleSuccessResponse.

public void handleSuccessResponse(SessionId sessionId, SamlResponseDto samlResponse) {
    getSessionIfItExists(sessionId);
    SamlResponseContainerDto samlResponseContainer = new SamlResponseContainerDto(samlResponse.getSamlResponse(), sessionRepository.getRequestIssuerEntityId(sessionId));
    try {
        InboundResponseFromMatchingServiceDto inboundResponseFromMatchingServiceDto = samlEngineProxy.translateMatchingServiceResponse(samlResponseContainer);
        updateSessionState(sessionId, inboundResponseFromMatchingServiceDto);
    } catch (ApplicationException e) {
        // this is not ideal but if the call to saml-proxy fails we want to log the failure
        // in the state and then process the exception
        logExceptionAndUpdateState("Error translating matching service response", sessionId, e);
    }
}
Also used : ApplicationException(uk.gov.ida.exceptions.ApplicationException) SamlResponseContainerDto(uk.gov.ida.hub.policy.contracts.SamlResponseContainerDto) InboundResponseFromMatchingServiceDto(uk.gov.ida.hub.policy.contracts.InboundResponseFromMatchingServiceDto)

Aggregations

ApplicationException (uk.gov.ida.exceptions.ApplicationException)1 InboundResponseFromMatchingServiceDto (uk.gov.ida.hub.policy.contracts.InboundResponseFromMatchingServiceDto)1 SamlResponseContainerDto (uk.gov.ida.hub.policy.contracts.SamlResponseContainerDto)1