Search in sources :

Example 1 with SamlAuthnResponseContainerDto

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

the class SessionResourceAuthnResponseFromIdpIntegrationTests method setUp.

@Before
public void setUp() throws Exception {
    samlResponse = SamlResponseWithAuthnRequestInformationDtoBuilder.aSamlResponseWithAuthnRequestInformationDto().withIssuer(THE_TRANSACTION_ID).build();
    samlRequest = SamlAuthnRequestContainerDtoBuilder.aSamlAuthnRequestContainerDto().build();
    configStub.setupStubForEnabledIdps(THE_TRANSACTION_ID, REGISTERING, REQUESTED_LOA, ImmutableList.of(idpEntityId, "differentIdp"));
    configStub.setUpStubForLevelsOfAssurance(samlResponse.getIssuer());
    configStub.setupStubForEidasEnabledForTransaction(THE_TRANSACTION_ID, false);
    eventSinkStub.setupStubForLogging();
    configStub.setUpStubForMatchingServiceRequest(samlResponse.getIssuer(), matchingServiceEntityId);
    sessionId = aSessionIsCreated();
    anIdpIsSelectedForRegistration(sessionId, idpEntityId);
    anAuthnRequestHasBeenSentToAnIdp(sessionId);
    samlResponseDto = new SamlAuthnResponseContainerDto("a-saml-response", sessionId, "an-ip-address");
}
Also used : SamlAuthnResponseContainerDto(uk.gov.ida.hub.policy.contracts.SamlAuthnResponseContainerDto) Before(org.junit.Before)

Example 2 with SamlAuthnResponseContainerDto

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

the class EidasSessionResourceContractTest method createAuthnResponseSignedByKeyPair.

private static SamlAuthnResponseContainerDto createAuthnResponseSignedByKeyPair(SessionId sessionId, String publicKey, String privateKey) throws Exception {
    AuthnResponseFactory authnResponseFactory = AuthnResponseFactory.anAuthnResponseFactory();
    String samlResponse = authnResponseFactory.aSamlResponseFromCountry("a-request", COUNTRY_ENTITY_ID, publicKey, privateKey, DESTINATION, SIGNATURE_ALGORITHM, DIGEST_ALGORITHM, EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256_GCM, EidasAuthnContext.EIDAS_LOA_SUBSTANTIAL, DESTINATION, COUNTRY_ENTITY_ID);
    return new SamlAuthnResponseContainerDto(samlResponse, sessionId, "127.0.0.1");
}
Also used : SamlAuthnResponseContainerDto(uk.gov.ida.hub.policy.contracts.SamlAuthnResponseContainerDto) AuthnResponseFactory(uk.gov.ida.saml.idp.test.AuthnResponseFactory)

Example 3 with SamlAuthnResponseContainerDto

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

the class MatchingServiceResourcesIntegrationTest method anAuthnResponseFromIdpWasReceivedAndMatchingRequestSent.

private void anAuthnResponseFromIdpWasReceivedAndMatchingRequestSent(SessionId sessionId) throws JsonProcessingException {
    final URI policyUri = policy.uri(UriBuilder.fromPath(Urls.PolicyUrls.IDP_AUTHN_RESPONSE_RESOURCE).build(sessionId).getPath());
    SamlAuthnResponseContainerDto samlAuthnResponseContainerDto = new SamlAuthnResponseContainerDto("saml-response", new SessionId(sessionId.getSessionId()), "principal-ip-address");
    InboundResponseFromIdpDto inboundResponseFromIdpDto = InboundResponseFromIdpDtoBuilder.successResponse(idpEntityId, LEVEL_2);
    configStub.setUpStubForMatchingServiceRequest(rpEntityId, msaEntityId);
    samlEngineStub.setupStubForAttributeQueryRequest(AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto().build());
    samlEngineStub.setupStubForIdpAuthnResponseTranslate(inboundResponseFromIdpDto);
    samlSoapProxyProxyStubRule.setUpStubForSendHubMatchingServiceRequest(sessionId);
    postResponse(policyUri, samlAuthnResponseContainerDto);
}
Also used : InboundResponseFromIdpDto(uk.gov.ida.hub.policy.domain.InboundResponseFromIdpDto) SamlAuthnResponseContainerDto(uk.gov.ida.hub.policy.contracts.SamlAuthnResponseContainerDto) URI(java.net.URI) SessionId(uk.gov.ida.hub.policy.domain.SessionId)

Aggregations

SamlAuthnResponseContainerDto (uk.gov.ida.hub.policy.contracts.SamlAuthnResponseContainerDto)3 URI (java.net.URI)1 Before (org.junit.Before)1 InboundResponseFromIdpDto (uk.gov.ida.hub.policy.domain.InboundResponseFromIdpDto)1 SessionId (uk.gov.ida.hub.policy.domain.SessionId)1 AuthnResponseFactory (uk.gov.ida.saml.idp.test.AuthnResponseFactory)1