Search in sources :

Example 1 with AssertionsDecrypters

use of uk.gov.ida.saml.core.security.AssertionsDecrypters in project verify-hub by alphagov.

the class IdpResponseValidatorTest method setUp.

@BeforeEach
public void setUp() {
    validator = new IdpResponseValidator(samlResponseSignatureValidator, new AssertionsDecrypters(List.of(assertionDecrypter, badAssertionDecrypter)), samlAssertionsSignatureValidator, encryptedResponseFromIdpValidator, responseDestinationValidator, responseAssertionsFromIdpValidator);
    final Logger logger = (Logger) LoggerFactory.getLogger(IdpResponseValidator.class.getSimpleName());
    logger.addAppender(mockAppender);
    logger.setLevel(Level.WARN);
}
Also used : AssertionsDecrypters(uk.gov.ida.saml.core.security.AssertionsDecrypters) Logger(ch.qos.logback.classic.Logger) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with AssertionsDecrypters

use of uk.gov.ida.saml.core.security.AssertionsDecrypters 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);
}
Also used : AssertionSubjectValidator(uk.gov.ida.saml.core.validators.subject.AssertionSubjectValidator) IssuerValidator(uk.gov.ida.saml.security.validators.issuer.IssuerValidator) AssertionAttributeStatementValidator(uk.gov.ida.saml.core.validation.assertion.AssertionAttributeStatementValidator) DecoratedSamlResponseToInboundResponseFromMatchingServiceTransformer(uk.gov.ida.saml.hub.transformers.inbound.providers.DecoratedSamlResponseToInboundResponseFromMatchingServiceTransformer) AssertionValidator(uk.gov.ida.saml.core.validation.assertion.AssertionValidator) MatchingDatasetAssertionValidator(uk.gov.ida.saml.core.validators.assertion.MatchingDatasetAssertionValidator) AuthnStatementAssertionValidator(uk.gov.ida.saml.core.validators.assertion.AuthnStatementAssertionValidator) IdentityProviderAssertionValidator(uk.gov.ida.saml.core.validation.assertion.IdentityProviderAssertionValidator) BasicAssertionSubjectConfirmationValidator(uk.gov.ida.saml.core.validation.subjectconfirmation.BasicAssertionSubjectConfirmationValidator) MatchingServiceResponseValidator(uk.gov.ida.saml.hub.validators.response.matchingservice.MatchingServiceResponseValidator) MatchingServiceIdaStatusUnmarshaller(uk.gov.ida.saml.hub.transformers.inbound.MatchingServiceIdaStatusUnmarshaller) ResponseAssertionsFromMatchingServiceValidator(uk.gov.ida.saml.hub.validators.response.matchingservice.ResponseAssertionsFromMatchingServiceValidator) AssertionsDecrypters(uk.gov.ida.saml.core.security.AssertionsDecrypters) InboundResponseFromMatchingServiceUnmarshaller(uk.gov.ida.saml.hub.transformers.inbound.InboundResponseFromMatchingServiceUnmarshaller) EncryptedResponseFromMatchingServiceValidator(uk.gov.ida.saml.hub.validators.response.matchingservice.EncryptedResponseFromMatchingServiceValidator) SamlMessageSignatureValidator(uk.gov.ida.saml.security.SamlMessageSignatureValidator) SamlAssertionsSignatureValidator(uk.gov.ida.saml.security.SamlAssertionsSignatureValidator) SignatureValidator(uk.gov.ida.saml.security.SignatureValidator) SamlResponseSignatureValidator(uk.gov.ida.saml.security.validators.signature.SamlResponseSignatureValidator)

Example 3 with AssertionsDecrypters

use of uk.gov.ida.saml.core.security.AssertionsDecrypters in project verify-hub by alphagov.

the class MatchingServiceResponseValidatorTest method setUp.

@BeforeEach
public void setUp() {
    validator = new MatchingServiceResponseValidator(encryptedResponseFromMatchingServiceValidator, samlResponseSignatureValidator, new AssertionsDecrypters(List.of(assertionDecrypter, badAssertionDecrypter)), samlAssertionsSignatureValidator, responseAssertionsFromMatchingServiceValidator);
    final Logger logger = (Logger) LoggerFactory.getLogger(MatchingServiceResponseValidator.class.getSimpleName());
    logger.addAppender(mockAppender);
    logger.setLevel(Level.WARN);
}
Also used : AssertionsDecrypters(uk.gov.ida.saml.core.security.AssertionsDecrypters) Logger(ch.qos.logback.classic.Logger) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AssertionsDecrypters (uk.gov.ida.saml.core.security.AssertionsDecrypters)3 Logger (ch.qos.logback.classic.Logger)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 AssertionAttributeStatementValidator (uk.gov.ida.saml.core.validation.assertion.AssertionAttributeStatementValidator)1 AssertionValidator (uk.gov.ida.saml.core.validation.assertion.AssertionValidator)1 IdentityProviderAssertionValidator (uk.gov.ida.saml.core.validation.assertion.IdentityProviderAssertionValidator)1 BasicAssertionSubjectConfirmationValidator (uk.gov.ida.saml.core.validation.subjectconfirmation.BasicAssertionSubjectConfirmationValidator)1 AuthnStatementAssertionValidator (uk.gov.ida.saml.core.validators.assertion.AuthnStatementAssertionValidator)1 MatchingDatasetAssertionValidator (uk.gov.ida.saml.core.validators.assertion.MatchingDatasetAssertionValidator)1 AssertionSubjectValidator (uk.gov.ida.saml.core.validators.subject.AssertionSubjectValidator)1 InboundResponseFromMatchingServiceUnmarshaller (uk.gov.ida.saml.hub.transformers.inbound.InboundResponseFromMatchingServiceUnmarshaller)1 MatchingServiceIdaStatusUnmarshaller (uk.gov.ida.saml.hub.transformers.inbound.MatchingServiceIdaStatusUnmarshaller)1 DecoratedSamlResponseToInboundResponseFromMatchingServiceTransformer (uk.gov.ida.saml.hub.transformers.inbound.providers.DecoratedSamlResponseToInboundResponseFromMatchingServiceTransformer)1 EncryptedResponseFromMatchingServiceValidator (uk.gov.ida.saml.hub.validators.response.matchingservice.EncryptedResponseFromMatchingServiceValidator)1 MatchingServiceResponseValidator (uk.gov.ida.saml.hub.validators.response.matchingservice.MatchingServiceResponseValidator)1 ResponseAssertionsFromMatchingServiceValidator (uk.gov.ida.saml.hub.validators.response.matchingservice.ResponseAssertionsFromMatchingServiceValidator)1 SamlAssertionsSignatureValidator (uk.gov.ida.saml.security.SamlAssertionsSignatureValidator)1 SamlMessageSignatureValidator (uk.gov.ida.saml.security.SamlMessageSignatureValidator)1 SignatureValidator (uk.gov.ida.saml.security.SignatureValidator)1 IssuerValidator (uk.gov.ida.saml.security.validators.issuer.IssuerValidator)1