Class ExactMatchClaimsValidator
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.ExactMatchClaimsValidator
- All Implemented Interfaces:
ClaimsValidator,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
Validator that checks a JWT claim exactly matches (by Object equality) a value returned by a lookup strategy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe name of the claim to match from the ID token.private final org.slf4j.LoggerClass logger.Strategy to retrieve the value to match to an ID Token claim. -
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.voidsetClaimName(String name) Set the name of the claim to match.voidSet the value to match lookup strategy.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. -
valueToMatchLookupStrategy
@NonnullAfterInit private BiFunction<ProfileRequestContext,JWTClaimsSet, valueToMatchLookupStrategyString> Strategy to retrieve the value to match to an ID Token claim. Should return null if there is a failure to lookup the value. -
claimName
The name of the claim to match from the ID token.
-
-
Constructor Details
-
ExactMatchClaimsValidator
public ExactMatchClaimsValidator()
-
-
Method Details
-
setClaimName
Set the name of the claim to match.- Parameters:
name- the claim name.
-
setValueToMatchLookupStrategy
public void setValueToMatchLookupStrategy(@Nonnull BiFunction<ProfileRequestContext, JWTClaimsSet, String> strategy) Set the value to match lookup strategy.- Parameters:
strategy- the strategy to use.
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doValidate
protected 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
-