Class ExactMatchClaimsValidator
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.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
@ThreadSafeAfterInit public class ExactMatchClaimsValidator extends AbstractClaimsValidator
Validator that checks a JWT claim exactly matches (by Object equality) a value returned by a lookup strategy.
-
-
Field Summary
Fields Modifier and Type Field Description private StringclaimNameThe name of the claim to match from the ID token.private org.slf4j.LoggerlogClass logger.private BiFunction<ProfileRequestContext,com.nimbusds.jwt.JWTClaimsSet,String>valueToMatchLookupStrategyStrategy to retrieve the value to match to an ID Token claim.
-
Constructor Summary
Constructors Constructor Description ExactMatchClaimsValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected voiddoValidate(com.nimbusds.jwt.JWTClaimsSet claims, ProfileRequestContext context)voidsetClaimName(String name)Set the name of the claim to match.voidsetValueToMatchLookupStrategy(BiFunction<ProfileRequestContext,com.nimbusds.jwt.JWTClaimsSet,String> strategy)Set the value to match lookup strategy.-
Methods inherited from class net.shibboleth.oidc.jwt.claims.AbstractClaimsValidator
setActivationCondition, validate
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiableComponent
setId
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
valueToMatchLookupStrategy
@NonnullAfterInit private BiFunction<ProfileRequestContext,com.nimbusds.jwt.JWTClaimsSet,String> valueToMatchLookupStrategy
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
@NonnullAfterInit @NotEmpty private String claimName
The name of the claim to match from the ID token.
-
-
Method Detail
-
setClaimName
public void setClaimName(@Nonnull @NotEmpty String name)
Set the name of the claim to match.- Parameters:
name- the claim name.
-
setValueToMatchLookupStrategy
public void setValueToMatchLookupStrategy(@Nonnull BiFunction<ProfileRequestContext,com.nimbusds.jwt.JWTClaimsSet,String> strategy)Set the value to match lookup strategy.- Parameters:
strategy- the strategy to use.
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doValidate
protected void doValidate(@Nonnull com.nimbusds.jwt.JWTClaimsSet claims, @Nonnull ProfileRequestContext context) throws JWTValidationException- Specified by:
doValidatein classAbstractClaimsValidator- Throws:
JWTValidationException
-
-