Class DefaultOpenIdClient

    • Constructor Detail

      • DefaultOpenIdClient

        public DefaultOpenIdClient​(OauthClientConfiguration clientConfiguration,
                                   OpenIdProviderMetadata openIdProviderMetadata,
                                   @Nullable
                                   OpenIdUserDetailsMapper userDetailsMapper,
                                   AuthorizationRedirectHandler redirectUrlBuilder,
                                   OpenIdAuthorizationResponseHandler authorizationResponseHandler,
                                   io.micronaut.context.BeanContext beanContext,
                                   @Nullable
                                   EndSessionEndpoint endSessionEndpoint)
        Parameters:
        clientConfiguration - The client configuration
        openIdProviderMetadata - The provider metadata
        userDetailsMapper - The user details mapper
        redirectUrlBuilder - The redirect URL builder
        authorizationResponseHandler - The authorization response handler
        beanContext - The bean context
        endSessionEndpoint - The end session request
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface OauthClient
        Returns:
        The provider name
      • supportsEndSession

        public boolean supportsEndSession()
        Specified by:
        supportsEndSession in interface OpenIdClient
        Returns:
        True if this client supports end session
      • endSessionRedirect

        public java.util.Optional<io.micronaut.http.HttpResponse> endSessionRedirect​(io.micronaut.http.HttpRequest request,
                                                                                     Authentication authentication)
        Description copied from interface: OpenIdClient
        Redirects to the end session endpoint of an OpenID provider. Returns an empty optional if the provider does not support end session or an EndSessionEndpoint could not be resolved for the provider.
        Specified by:
        endSessionRedirect in interface OpenIdClient
        Parameters:
        request - The current request
        authentication - The current authentication
        Returns:
        An optional response
      • authorizationRedirect

        public org.reactivestreams.Publisher<io.micronaut.http.HttpResponse> authorizationRedirect​(io.micronaut.http.HttpRequest originating)
        Description copied from interface: OauthClient
        Responsible for redirecting to the authorization endpoint.
        Specified by:
        authorizationRedirect in interface OauthClient
        Parameters:
        originating - The originating request
        Returns:
        A response publisher
      • onCallback

        public org.reactivestreams.Publisher<AuthenticationResponse> onCallback​(io.micronaut.http.HttpRequest<java.util.Map<java.lang.String,​java.lang.Object>> request)
        Description copied from interface: OauthClient
        Responsible for receiving the authorization callback request and returning an authentication response.
        Specified by:
        onCallback in interface OauthClient
        Parameters:
        request - The callback request
        Returns:
        The authentication response
      • isErrorCallback

        protected boolean isErrorCallback​(io.micronaut.core.convert.value.ConvertibleMultiValues<java.lang.String> responseData)
        Parameters:
        responseData - The response data
        Returns:
        True if the response indicates an error occurred.
      • getTokenEndpoint

        protected SecureEndpoint getTokenEndpoint()
        Returns:
        The token endpoint