Class ExtractClientAuthenticationFromRequest

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

    public class ExtractClientAuthenticationFromRequest
    extends net.shibboleth.idp.authn.AbstractExtractionAction
    Extracts OAuth 2 client authentication details from a request and stores them in an OAuth2ClientAuthenticationContext beneath the AuthenticationContext for subsequent validation.

    Depending on the form of authentication, additional child contexts may be created to store extracted credentials, and they may undergo configured transformations. For example, password-based methods will result in a UsernamePasswordContext, certificate-based in an CertificateContext, etc.

    Event:
    EventIds.PROCEED_EVENT_ID, EventIds.INVALID_MSG_CTX, AuthnEventIds.NO_CREDENTIALS
    Precondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
    Postcondition:
    AuthenticationContext.getSubcontext(OAuth2ClientAuthenticationContext.class) ! null along with other contexts as appropriate
    • Field Detail

      • log

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

        @NonnullAfterInit
        private Function<ProfileRequestContext,​Set<com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod>> clientAuthMethodsLookupStrategy
        Lookup strategy for enabled client authentication methods.
      • request

        @Nullable
        private com.nimbusds.oauth2.sdk.AbstractOptionallyAuthenticatedRequest request
        Message to extract credentials from.
    • Constructor Detail

      • ExtractClientAuthenticationFromRequest

        public ExtractClientAuthenticationFromRequest()
        Constructor.
    • Method Detail

      • setClientAuthMethodsLookupStrategy

        public void setClientAuthMethodsLookupStrategy​(@Nonnull
                                                       Function<ProfileRequestContext,​Set<com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod>> strategy)
        Set the lookup strategy for enabled client authentication methods.
        Parameters:
        strategy - What to set.
      • 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