Package org.apache.wss4j.stax.validate
Class SamlTokenValidatorImpl
java.lang.Object
org.apache.wss4j.stax.validate.SignatureTokenValidatorImpl
org.apache.wss4j.stax.validate.SamlTokenValidatorImpl
- All Implemented Interfaces:
SamlTokenValidator,SignatureTokenValidator,Validator
public class SamlTokenValidatorImpl
extends SignatureTokenValidatorImpl
implements SamlTokenValidator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAuthnStatements(SamlAssertionWrapper samlAssertion) Check the AuthnStatements of the Assertion (if any)protected voidcheckConditions(SamlAssertionWrapper samlAssertion) Check the Conditions of the Assertion.protected voidcheckConditions(SamlAssertionWrapper samlAssertion, List<String> audienceRestrictions) Check the Conditions of the Assertion.protected voidcheckOneTimeUse(SamlAssertionWrapper samlAssertion, ReplayCache replayCache) Check the "OneTimeUse" Condition of the Assertion.intgetTtl()booleanbooleanbooleanWhether to validate the signature of the Assertion (if it exists) against the relevant profile.voidsetFutureTTL(int newFutureTTL) Set the time in seconds in the future within which the NotBefore time of an incoming Assertion is valid.voidsetRequireBearerSignature(boolean requireBearerSignature) voidsetRequiredSubjectConfirmationMethod(String requiredSubjectConfirmationMethod) voidsetRequireStandardSubjectConfirmationMethod(boolean requireStandardSubjectConfirmationMethod) voidsetTtl(int ttl) voidsetValidateSignatureAgainstProfile(boolean validateSignatureAgainstProfile) Whether to validate the signature of the Assertion (if it exists) against the relevant profile.<T extends SamlSecurityToken & org.apache.xml.security.stax.securityToken.InboundSecurityToken>
Tvalidate(SamlAssertionWrapper samlAssertionWrapper, org.apache.xml.security.stax.securityToken.InboundSecurityToken subjectSecurityToken, TokenContext tokenContext) protected voidvalidateAssertion(SamlAssertionWrapper samlAssertion) Validate the samlAssertion against schemas/profilesprotected voidverifySubjectConfirmationMethod(SamlAssertionWrapper samlAssertion) Check the Subject Confirmation method requirementsMethods inherited from class org.apache.wss4j.stax.validate.SignatureTokenValidatorImpl
validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.wss4j.stax.validate.SignatureTokenValidator
validate
-
Constructor Details
-
SamlTokenValidatorImpl
public SamlTokenValidatorImpl()
-
-
Method Details
-
setFutureTTL
public void setFutureTTL(int newFutureTTL) Set the time in seconds in the future within which the NotBefore time of an incoming Assertion is valid. The default is 60 seconds. -
isValidateSignatureAgainstProfile
public boolean isValidateSignatureAgainstProfile()Whether to validate the signature of the Assertion (if it exists) against the relevant profile. Default is true. -
setValidateSignatureAgainstProfile
public void setValidateSignatureAgainstProfile(boolean validateSignatureAgainstProfile) Whether to validate the signature of the Assertion (if it exists) against the relevant profile. Default is true. -
getRequiredSubjectConfirmationMethod
-
setRequiredSubjectConfirmationMethod
-
validate
public <T extends SamlSecurityToken & org.apache.xml.security.stax.securityToken.InboundSecurityToken> T validate(SamlAssertionWrapper samlAssertionWrapper, org.apache.xml.security.stax.securityToken.InboundSecurityToken subjectSecurityToken, TokenContext tokenContext) throws WSSecurityException - Specified by:
validatein interfaceSamlTokenValidator- Throws:
WSSecurityException
-
verifySubjectConfirmationMethod
protected void verifySubjectConfirmationMethod(SamlAssertionWrapper samlAssertion) throws WSSecurityException Check the Subject Confirmation method requirements- Throws:
WSSecurityException
-
checkConditions
protected void checkConditions(SamlAssertionWrapper samlAssertion, List<String> audienceRestrictions) throws WSSecurityException Check the Conditions of the Assertion.- Throws:
WSSecurityException
-
checkConditions
Check the Conditions of the Assertion.- Throws:
WSSecurityException
-
checkAuthnStatements
Check the AuthnStatements of the Assertion (if any)- Throws:
WSSecurityException
-
checkOneTimeUse
protected void checkOneTimeUse(SamlAssertionWrapper samlAssertion, ReplayCache replayCache) throws WSSecurityException Check the "OneTimeUse" Condition of the Assertion. If this is set then the Assertion is cached (if a cache is defined), and must not have been previously cached- Throws:
WSSecurityException
-
validateAssertion
Validate the samlAssertion against schemas/profiles- Throws:
WSSecurityException
-
isRequireStandardSubjectConfirmationMethod
public boolean isRequireStandardSubjectConfirmationMethod() -
setRequireStandardSubjectConfirmationMethod
public void setRequireStandardSubjectConfirmationMethod(boolean requireStandardSubjectConfirmationMethod) -
isRequireBearerSignature
public boolean isRequireBearerSignature() -
setRequireBearerSignature
public void setRequireBearerSignature(boolean requireBearerSignature) -
getTtl
public int getTtl() -
setTtl
public void setTtl(int ttl)
-