Class IssuedAtClaimsValidator
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.oidc.jwt.claims.AbstractClaimsValidator
net.shibboleth.oidc.security.jwt.claims.impl.IssuedAtClaimsValidator
- All Implemented Interfaces:
ClaimsValidator,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
If the 'iat' claim is present in the JWT, verifies it is not to far away from the current time.
The message lifetime, clock skew and the claim existence requirement can be configured.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DurationClock skew adjustment in both directions to consider still acceptable (Default value: 1 minute).private DurationAmount of time for which a message is valid after it is issued (Default value: 1 minute).private booleanWhether this rule is required to be met. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoValidate(JWTClaimsSet claims, ProfileRequestContext context) Perform validation of the given claims supported by the supplied context.voidsetClockSkew(Duration skew) Set the clock skew.voidsetMessageLifetime(Duration lifetime) Sets the amount of time for which a message is valid.voidsetRequiredRule(boolean required) Sets whether this rule is required to be met.Methods inherited from class net.shibboleth.oidc.jwt.claims.AbstractClaimsValidator
setActivationCondition, validateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiableComponent
setIdMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
clockSkew
Clock skew adjustment in both directions to consider still acceptable (Default value: 1 minute). -
messageLifetime
Amount of time for which a message is valid after it is issued (Default value: 1 minute). -
requiredRule
private boolean requiredRuleWhether this rule is required to be met.
-
-
Constructor Details
-
IssuedAtClaimsValidator
public IssuedAtClaimsValidator()Constructor.
-
-
Method Details
-
setMessageLifetime
Sets the amount of time for which a message is valid.- Parameters:
lifetime- amount of time for which a message is valid
-
setClockSkew
Set the clock skew.- Parameters:
skew- clock skew to set
-
setRequiredRule
public void setRequiredRule(boolean required) Sets whether this rule is required to be met.- Parameters:
required- whether this rule is required to be met
-
doValidate
public void doValidate(@Nonnull JWTClaimsSet claims, @Nonnull ProfileRequestContext context) throws JWTValidationException Perform validation of the given claims supported by the supplied context.- Specified by:
doValidatein classAbstractClaimsValidator- Parameters:
claims- the claims to validate.context- the profile request context.- Throws:
JWTValidationException- when validation is unsuccessful due to a failed attempt
-