Class AttributeTokenRevocationCondition
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.oidc.op.profile.logic.AttributeTokenRevocationCondition
- All Implemented Interfaces:
BiPredicate<ProfileRequestContext,,JWTClaimsSet> Component,DestructableComponent,InitializableComponent
public class AttributeTokenRevocationCondition
extends AbstractInitializableComponent
implements BiPredicate<ProfileRequestContext,JWTClaimsSet>
A condition that checks for token revocation against a resolved
IdPAttribute.- Since:
- 4.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringAttribute ID to resolve.private ReloadableService<AttributeResolver>Attribute Resolver service.private Function<ProfileRequestContext,String> Strategy used to locate the identity of the issuer associated with the attribute resolution.private final org.slf4j.LoggerClass logger.Lookup strategy for principal name.private Function<ProfileRequestContext,String> Strategy used to locate the identity of the recipient associated with the attribute resolution. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate AttributeResolutionContextbuildResolutionContext(ProfileRequestContext profileRequestContext, String principal) Build anAttributeResolutionContextto use.protected voidprotected booleanisRevoked(String principal, JWTClaimsSet claimsSet, Collection<Instant> revocationRecords) Check the revocation records' timestamps for applicability.voidsetAttributeId(String id) Set the ID of anIdPAttributeto resolve to obtain revocation records for the principal.voidSetAttributeResolverto use.voidSet the strategy used to lookup the issuer for this attribute resolution.voidSet lookup strategy for principal name.voidSet the strategy used to lookup the recipient for this attribute resolution.booleantest(ProfileRequestContext profileRequestContext, JWTClaimsSet claimsSet) Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiPredicate
and, negate, or
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
principalNameLookupStrategy
@NonnullAfterInit private BiFunction<ProfileRequestContext,JWTClaimsSet, principalNameLookupStrategyString> Lookup strategy for principal name. -
issuerLookupStrategy
Strategy used to locate the identity of the issuer associated with the attribute resolution. -
recipientLookupStrategy
Strategy used to locate the identity of the recipient associated with the attribute resolution. -
attributeResolver
Attribute Resolver service. -
attributeId
Attribute ID to resolve.
-
-
Constructor Details
-
AttributeTokenRevocationCondition
public AttributeTokenRevocationCondition()Constructor.
-
-
Method Details
-
setPrincipalNameLookupStrategy
public void setPrincipalNameLookupStrategy(@Nonnull BiFunction<ProfileRequestContext, JWTClaimsSet, String> strategy) Set lookup strategy for principal name.- Parameters:
strategy- lookup strategy
-
setIssuerLookupStrategy
Set the strategy used to lookup the issuer for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setRecipientLookupStrategy
Set the strategy used to lookup the recipient for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setAttributeId
Set the ID of anIdPAttributeto resolve to obtain revocation records for the principal.- Parameters:
id- attribute ID to resolve
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
test
public boolean test(@Nullable ProfileRequestContext profileRequestContext, @Nullable JWTClaimsSet claimsSet) - Specified by:
testin interfaceBiPredicate<ProfileRequestContext,JWTClaimsSet>
-
buildResolutionContext
@Nonnull private AttributeResolutionContext buildResolutionContext(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String principal) Build anAttributeResolutionContextto use.- Parameters:
profileRequestContext- profile request contextprincipal- name of principal- Returns:
- the attached context
-
isRevoked
protected boolean isRevoked(@Nonnull @NotEmpty String principal, @Nonnull JWTClaimsSet claimsSet, @Nonnull Collection<Instant> revocationRecords) Check the revocation records' timestamps for applicability.- Parameters:
principal- name of principalclaimsSet- claims set containingTokenClaimsSet.KEY_AUTH_TIMErevocationRecords- the records from the cache- Returns:
- true iff the revocation applies to this claims set
-