Class DefaultOauthClient

java.lang.Object
io.micronaut.security.oauth2.client.DefaultOauthClient
All Implemented Interfaces:
OauthClient

@EachBean(OauthAuthenticationMapper.class) @Requires(condition=OauthClientCondition.class) public class DefaultOauthClient extends Object implements OauthClient
The default implementation of OauthClient.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

    • DefaultOauthClient

      public DefaultOauthClient(@Parameter OauthAuthenticationMapper authenticationMapper, @Parameter OauthClientConfiguration clientConfiguration, AuthorizationRedirectHandler redirectHandler, OauthAuthorizationResponseHandler authorizationResponseHandler, io.micronaut.context.BeanContext beanContext)
      Parameters:
      clientConfiguration - The client configuration
      authenticationMapper - The user details mapper
      redirectHandler - The redirect URL builder
      authorizationResponseHandler - The authorization response handler
      beanContext - The bean context
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface OauthClient
      Returns:
      The provider name
    • authorizationRedirect

      public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> 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<Map<String,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<String> responseData)
      Parameters:
      responseData - The response data
      Returns:
      True if the response indicates an error occurred.