Class DefaultTokenEndpointClient

java.lang.Object
io.micronaut.security.oauth2.endpoint.token.request.DefaultTokenEndpointClient
All Implemented Interfaces:
TokenEndpointClient

@Singleton public class DefaultTokenEndpointClient extends Object implements TokenEndpointClient
The default implementation of TokenEndpointClient.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

    • DefaultTokenEndpointClient

      public DefaultTokenEndpointClient(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration)
      Parameters:
      beanContext - The bean context
      defaultClientConfiguration - The default client configuration
  • Method Details

    • sendRequest

      @NonNull public <G, R extends TokenResponse> @NonNull org.reactivestreams.Publisher<R> sendRequest(TokenRequestContext<G,R> requestContext)
      Specified by:
      sendRequest in interface TokenEndpointClient
      Type Parameters:
      G - The token request grant or body
      R - The token response type
      Parameters:
      requestContext - The token request context
      Returns:
      a HTTP Request to the Token Endpoint with Authorization Code Grant payload.
    • secureRequest

      protected <G, R extends TokenResponse> void secureRequest(@NonNull @NonNull io.micronaut.http.MutableHttpRequest<G> request, TokenRequestContext<G,R> requestContext)
      Secures the request according to the context's endpoint supported authentication methods.
      Type Parameters:
      G - The token request grant or body
      R - The token response type
      Parameters:
      request - Token endpoint Request
      requestContext - The request context
    • getClient

      protected io.micronaut.http.client.HttpClient getClient(String providerName)
      Retrieves a client for the given provider.
      Parameters:
      providerName - The provider name
      Returns:
      An HTTP client to use to send the request