Class ValidateTokenClaims

  • All Implemented Interfaces:
    Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action

    public class ValidateTokenClaims
    extends net.shibboleth.idp.authn.AbstractAuthenticationAction
    Action that validates the claims of a JWT using the supplied claims validator. The verifier must be thread-safe and validate, at minimum, the claims set against the OpenID Connect core 1.0 section 3.1.3.7 specification.
    Event:
    EventIds.PROCEED_EVENT_ID, AuthnEventIds.INVALID_AUTHN_CTX, OidcEventIds.INVALID_TOKEN
    Precondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class, false) != null
    ,
    JWT.getJWTClaimsSet() != null
    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • cleanupHook

        @Nullable
        private Consumer<ProfileRequestContext> cleanupHook
        A cleanup hook to execute after either a successful or unsuccessful claims validation.
      • claimsSet

        @Nullable
        private com.nimbusds.jwt.JWTClaimsSet claimsSet
        The parsed claimset.
      • claimsValidator

        @NonnullAfterInit
        private net.shibboleth.oidc.jwt.claims.ClaimsValidator claimsValidator
        The JWT claims validator used to verify the claimsset.
    • Constructor Detail

      • ValidateTokenClaims

        public ValidateTokenClaims()
    • Method Detail

      • setJwtLookupStrategy

        public void setJwtLookupStrategy​(@Nonnull
                                         Function<ProfileRequestContext,​com.nimbusds.jwt.JWT> strategy)
        Set the lookup strategy that locates the JWT to validate from the context.
        Parameters:
        strategy - the strategy
      • setCleanupHook

        public void setCleanupHook​(@Nullable
                                   Consumer<ProfileRequestContext> hook)
        Set the cleanup hook to execute after either a successful or unsuccessful claims validation.
        Parameters:
        hook - cleanup hook
      • setClaimsValidator

        public void setClaimsValidator​(@Nonnull
                                       net.shibboleth.oidc.jwt.claims.ClaimsValidator validator)
        Set the JWT claims verifier to use.
        Parameters:
        validator - the claims validator.
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       ProfileRequestContext profileRequestContext,
                                       @Nonnull
                                       net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
        Overrides:
        doPreExecute in class net.shibboleth.idp.authn.AbstractAuthenticationAction
      • doExecute

        protected void doExecute​(@Nonnull
                                 ProfileRequestContext profileRequestContext,
                                 @Nonnull
                                 net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
        Overrides:
        doExecute in class net.shibboleth.idp.authn.AbstractAuthenticationAction