Search in sources :

Example 6 with AuthnRequestFromRelyingParty

use of uk.gov.ida.saml.hub.domain.AuthnRequestFromRelyingParty in project verify-hub by alphagov.

the class UnknownMethodAlgorithmLoggerTest method shouldReportUnknownSignatureAndDigestAlgorithmsInSPAuthnRequest.

@Test
public void shouldReportUnknownSignatureAndDigestAlgorithmsInSPAuthnRequest() throws Exception {
    AuthnRequestFromRelyingParty authnRequestFromRelyingParty = anAuthnRequestFromRelyingParty().withId(ID).withIssuer(ISSUER_SP).withSignature(signatureWithUnknownSignatureAndDigestAlgorithms.get()).build();
    UnknownMethodAlgorithmLogger.probeAuthnRequestForMethodAlgorithm(authnRequestFromRelyingParty);
    verifyLog(mockAppender, captorLoggingEvent, 1, String.format(UnknownMethodAlgorithmLogger.SIGNATURE_AND_DIGEST_ALGORITHMS_MESSAGE, SP, SIGNATURE_RSASHA1_ID, DIGEST_SHA1_ID, AuthnRequest.DEFAULT_ELEMENT_LOCAL_NAME));
}
Also used : AuthnRequestFromRelyingParty(uk.gov.ida.saml.hub.domain.AuthnRequestFromRelyingParty) AuthnRequestFromRelyingPartyBuilder.anAuthnRequestFromRelyingParty(uk.gov.ida.hub.samlengine.builders.AuthnRequestFromRelyingPartyBuilder.anAuthnRequestFromRelyingParty) Test(org.junit.Test)

Aggregations

AuthnRequestFromRelyingParty (uk.gov.ida.saml.hub.domain.AuthnRequestFromRelyingParty)6 Test (org.junit.Test)5 AuthnRequestFromRelyingPartyBuilder.anAuthnRequestFromRelyingParty (uk.gov.ida.hub.samlengine.builders.AuthnRequestFromRelyingPartyBuilder.anAuthnRequestFromRelyingParty)5 AuthnRequest (org.opensaml.saml.saml2.core.AuthnRequest)2 TranslatedAuthnRequestDto (uk.gov.ida.hub.samlengine.contracts.TranslatedAuthnRequestDto)2 URI (java.net.URI)1 DigestSHA256 (org.opensaml.xmlsec.algorithm.descriptors.DigestSHA256)1 Signature (org.opensaml.xmlsec.signature.Signature)1 SignatureImpl (org.opensaml.xmlsec.signature.impl.SignatureImpl)1 SamlRequestWithAuthnRequestInformationDto (uk.gov.ida.hub.samlengine.contracts.SamlRequestWithAuthnRequestInformationDto)1 SignatureBuilder.aSignature (uk.gov.ida.saml.core.test.builders.SignatureBuilder.aSignature)1