use of uk.gov.ida.saml.security.validators.issuer.IssuerValidator in project verify-hub by alphagov.
the class AuthnRequestFromTransactionValidatorTest method setup.
@BeforeAll
public static void setup() {
SamlDuplicateRequestValidationConfiguration samlDuplicateRequestValidationConfiguration = () -> Duration.hours(2);
SamlAuthnRequestValidityDurationConfiguration samlAuthnRequestValidityDurationConfiguration = () -> Duration.minutes(5);
IdExpirationCache idExpirationCache = new ConcurrentMapIdExpirationCache(new ConcurrentHashMap<>());
validator = new AuthnRequestFromTransactionValidator(new IssuerValidator(), new DuplicateAuthnRequestValidator(idExpirationCache, samlDuplicateRequestValidationConfiguration), new AuthnRequestIssueInstantValidator(samlAuthnRequestValidityDurationConfiguration));
}
use of uk.gov.ida.saml.security.validators.issuer.IssuerValidator in project verify-hub by alphagov.
the class HubTransformersFactory method getResponseToInboundResponseFromMatchingServiceTransformer.
public DecoratedSamlResponseToInboundResponseFromMatchingServiceTransformer getResponseToInboundResponseFromMatchingServiceTransformer(SigningKeyStore signingKeyStore, IdaKeyStore keyStore, String hubEntityId) {
ResponseAssertionsFromMatchingServiceValidator responseAssertionsFromMatchingServiceValidator = new ResponseAssertionsFromMatchingServiceValidator(new AssertionValidator(new IssuerValidator(), new AssertionSubjectValidator(), new AssertionAttributeStatementValidator(), new BasicAssertionSubjectConfirmationValidator()), hubEntityId);
InboundResponseFromMatchingServiceUnmarshaller inboundResponseFromMatchingServiceUnmarshaller = new InboundResponseFromMatchingServiceUnmarshaller(getAssertionToPassthroughAssertionTransformer(), new MatchingServiceIdaStatusUnmarshaller());
SignatureValidator signatureValidator = getSignatureValidator(signingKeyStore);
MatchingServiceResponseValidator matchingServiceResponseValidator = new MatchingServiceResponseValidator(new EncryptedResponseFromMatchingServiceValidator(), getSamlResponseSignatureValidator(signatureValidator), new AssertionsDecrypters(getSamlResponseAssertionDecrypters(keyStore)), getSamlAssertionsSignatureValidator(signatureValidator), responseAssertionsFromMatchingServiceValidator);
return new DecoratedSamlResponseToInboundResponseFromMatchingServiceTransformer(matchingServiceResponseValidator, inboundResponseFromMatchingServiceUnmarshaller);
}
use of uk.gov.ida.saml.security.validators.issuer.IssuerValidator 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