Package org.pac4j.saml.profile.impl
Class AbstractSAML2ResponseValidator
- java.lang.Object
-
- org.pac4j.saml.profile.impl.AbstractSAML2ResponseValidator
-
- All Implemented Interfaces:
SAML2ResponseValidator
- Direct Known Subclasses:
SAML2AuthnResponseValidator,SAML2LogoutValidator
public abstract class AbstractSAML2ResponseValidator extends Object implements SAML2ResponseValidator
The abstract class for all SAML response validators.- Since:
- 3.4.0
- Author:
- Jerome Leleu
-
-
Field Summary
Fields Modifier and Type Field Description protected intacceptedSkewprotected org.opensaml.saml.saml2.encryption.Decrypterdecrypterprotected org.slf4j.Loggerloggerprotected LogoutHandlerlogoutHandlerprotected ReplayCacheProviderreplayCacheprotected SAML2SignatureTrustEngineProvidersignatureTrustEngineProviderprotected net.shibboleth.utilities.java.support.net.URIComparatoruriComparator
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSAML2ResponseValidator(SAML2SignatureTrustEngineProvider signatureTrustEngineProvider, org.opensaml.saml.saml2.encryption.Decrypter decrypter, LogoutHandler logoutHandler, ReplayCacheProvider replayCache)protectedAbstractSAML2ResponseValidator(SAML2SignatureTrustEngineProvider signatureTrustEngineProvider, org.opensaml.saml.saml2.encryption.Decrypter decrypter, LogoutHandler logoutHandler, ReplayCacheProvider replayCache, net.shibboleth.utilities.java.support.net.URIComparator uriComparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcomputeSloKey(String sessionIndex, org.opensaml.saml.saml2.core.NameID nameId)protected org.opensaml.saml.saml2.core.NameIDdecryptEncryptedId(org.opensaml.saml.saml2.core.EncryptedID encryptedId, org.opensaml.saml.saml2.encryption.Decrypter decrypter)Decrypts an EncryptedID, using a decrypter.protected booleanisDateValid(org.joda.time.DateTime issueInstant, int interval)protected booleanisIssueInstantValid(org.joda.time.DateTime issueInstant)voidsetAcceptedSkew(int acceptedSkew)protected voidvalidateIssueInstant(org.joda.time.DateTime issueInstant)protected voidvalidateIssuer(org.opensaml.saml.saml2.core.Issuer issuer, SAML2MessageContext context)Validate issuer format and value.protected voidvalidateIssuerIfItExists(org.opensaml.saml.saml2.core.Issuer isser, SAML2MessageContext context)protected voidvalidateSignature(org.opensaml.xmlsec.signature.Signature signature, String idpEntityId, org.opensaml.xmlsec.signature.support.SignatureTrustEngine trustEngine)Validate the given digital signature by checking its profile and value.protected voidvalidateSignatureIfItExists(org.opensaml.xmlsec.signature.Signature signature, SAML2MessageContext context, org.opensaml.xmlsec.signature.support.SignatureTrustEngine engine)protected voidvalidateSuccess(org.opensaml.saml.saml2.core.Status status)Validates that the response is a success.protected voidverifyEndpoint(org.opensaml.saml.saml2.metadata.Endpoint endpoint, String destination)protected voidverifyMessageReplay(SAML2MessageContext context)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pac4j.saml.profile.api.SAML2ResponseValidator
setMaximumAuthenticationLifetime, validate
-
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
acceptedSkew
protected int acceptedSkew
-
signatureTrustEngineProvider
protected final SAML2SignatureTrustEngineProvider signatureTrustEngineProvider
-
uriComparator
protected final net.shibboleth.utilities.java.support.net.URIComparator uriComparator
-
decrypter
protected final org.opensaml.saml.saml2.encryption.Decrypter decrypter
-
logoutHandler
protected final LogoutHandler logoutHandler
-
replayCache
protected final ReplayCacheProvider replayCache
-
-
Constructor Detail
-
AbstractSAML2ResponseValidator
protected AbstractSAML2ResponseValidator(SAML2SignatureTrustEngineProvider signatureTrustEngineProvider, org.opensaml.saml.saml2.encryption.Decrypter decrypter, LogoutHandler logoutHandler, ReplayCacheProvider replayCache)
-
AbstractSAML2ResponseValidator
protected AbstractSAML2ResponseValidator(SAML2SignatureTrustEngineProvider signatureTrustEngineProvider, org.opensaml.saml.saml2.encryption.Decrypter decrypter, LogoutHandler logoutHandler, ReplayCacheProvider replayCache, net.shibboleth.utilities.java.support.net.URIComparator uriComparator)
-
-
Method Detail
-
validateSuccess
protected void validateSuccess(org.opensaml.saml.saml2.core.Status status)
Validates that the response is a success.- Parameters:
status- the response status.
-
validateSignatureIfItExists
protected void validateSignatureIfItExists(org.opensaml.xmlsec.signature.Signature signature, SAML2MessageContext context, org.opensaml.xmlsec.signature.support.SignatureTrustEngine engine)
-
validateSignature
protected void validateSignature(org.opensaml.xmlsec.signature.Signature signature, String idpEntityId, org.opensaml.xmlsec.signature.support.SignatureTrustEngine trustEngine)Validate the given digital signature by checking its profile and value.- Parameters:
signature- the signatureidpEntityId- the idp entity idtrustEngine- the trust engine
-
validateIssuerIfItExists
protected void validateIssuerIfItExists(org.opensaml.saml.saml2.core.Issuer isser, SAML2MessageContext context)
-
validateIssuer
protected void validateIssuer(org.opensaml.saml.saml2.core.Issuer issuer, SAML2MessageContext context)Validate issuer format and value.- Parameters:
issuer- the issuercontext- the context
-
validateIssueInstant
protected void validateIssueInstant(org.joda.time.DateTime issueInstant)
-
isIssueInstantValid
protected boolean isIssueInstantValid(org.joda.time.DateTime issueInstant)
-
isDateValid
protected boolean isDateValid(org.joda.time.DateTime issueInstant, int interval)
-
verifyEndpoint
protected void verifyEndpoint(org.opensaml.saml.saml2.metadata.Endpoint endpoint, String destination)
-
verifyMessageReplay
protected void verifyMessageReplay(SAML2MessageContext context)
-
decryptEncryptedId
protected org.opensaml.saml.saml2.core.NameID decryptEncryptedId(org.opensaml.saml.saml2.core.EncryptedID encryptedId, org.opensaml.saml.saml2.encryption.Decrypter decrypter) throws SAMLExceptionDecrypts an EncryptedID, using a decrypter.- Parameters:
encryptedId- The EncryptedID to be decrypted.decrypter- The decrypter to use.- Returns:
- Decrypted ID or
nullif any input isnull. - Throws:
SAMLException- If the input ID cannot be decrypted.
-
computeSloKey
protected String computeSloKey(String sessionIndex, org.opensaml.saml.saml2.core.NameID nameId)
-
setAcceptedSkew
public final void setAcceptedSkew(int acceptedSkew)
- Specified by:
setAcceptedSkewin interfaceSAML2ResponseValidator
-
-