Class AccessTokenHashValidator
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.AccessTokenHashValidator
- All Implemented Interfaces:
ClaimsValidator,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
A validator that checks the access_token value matches its encoded at_hash representation in the
id_token.
- Since:
- 2.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,AccessToken> Strategy to find the access_token.private booleanAllow a missing at_hash claim.private Function<ProfileRequestContext,JWSHeader> Strategy to find the JOSE headers relating to the id_token the at_hash is taken from.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voiddoValidate(JWTClaimsSet claims, ProfileRequestContext context) Perform validation of the given claims supported by the supplied context.voidSet the lookup strategy used to locate the access_token.voidsetAllowMissing(boolean flag) Set whether a missing 'at_hash' claim is valid or not.voidSet the lookup strategy used to locate the JWS header of the id_token.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
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
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
accessTokenLookupStrategy
Strategy to find the access_token. -
joseHeaderLookupStrategy
Strategy to find the JOSE headers relating to the id_token the at_hash is taken from. -
allowMissing
private boolean allowMissingAllow a missing at_hash claim.
-
-
Constructor Details
-
AccessTokenHashValidator
public AccessTokenHashValidator()
-
-
Method Details
-
setAllowMissing
public void setAllowMissing(boolean flag) Set whether a missing 'at_hash' claim is valid or not.Defaults to false.
- Parameters:
flag- flag to set
-
setAccessTokenLookupStrategy
public void setAccessTokenLookupStrategy(@Nonnull Function<ProfileRequestContext, AccessToken> strategy) Set the lookup strategy used to locate the access_token.- Parameters:
strategy- the strategy.
-
setJoseHeaderLookupStrategy
public void setJoseHeaderLookupStrategy(@Nonnull Function<ProfileRequestContext, JWSHeader> strategy) Set the lookup strategy used to locate the JWS header of the id_token.- Parameters:
strategy- the strategy.
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doValidate
protected void doValidate(@Nonnull JWTClaimsSet claims, @Nonnull ProfileRequestContext context) throws JWTValidationException Description copied from class:AbstractClaimsValidatorPerform 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
-