use of uk.gov.ida.saml.hub.validators.authnrequest.DuplicateAuthnRequestValidator in project verify-hub by alphagov.
the class HubTransformersFactory method getAuthnRequestToAuthnRequestFromTransactionTransformer.
public AuthnRequestToIdaRequestFromRelyingPartyTransformer getAuthnRequestToAuthnRequestFromTransactionTransformer(final URI expectedDestinationHost, final SigningKeyStore signingKeyStore, final IdaKeyStore decryptionKeyStore, final IdExpirationCache duplicateIds, final SamlDuplicateRequestValidationConfiguration samlDuplicateRequestValidationConfiguration, final SamlAuthnRequestValidityDurationConfiguration samlAuthnRequestValidityDurationConfiguration) {
List<Credential> credential = new IdaKeyStoreCredentialRetriever(decryptionKeyStore).getDecryptingCredentials();
Decrypter decrypter = decrypterFactory.createDecrypter(credential);
return new AuthnRequestToIdaRequestFromRelyingPartyTransformer(new AuthnRequestFromRelyingPartyUnmarshaller(decrypter), coreTransformersFactory.getSamlRequestSignatureValidator(signingKeyStore), new DestinationValidator(expectedDestinationHost, Endpoints.SSO_REQUEST_ENDPOINT), new AuthnRequestFromTransactionValidator(new IssuerValidator(), new DuplicateAuthnRequestValidator(duplicateIds, samlDuplicateRequestValidationConfiguration), new AuthnRequestIssueInstantValidator(samlAuthnRequestValidityDurationConfiguration)));
}
Aggregations