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