Class DefaultTokenEndpointClient
- java.lang.Object
 - 
- io.micronaut.security.oauth2.endpoint.token.request.DefaultTokenEndpointClient
 
 
- 
- All Implemented Interfaces:
 TokenEndpointClient
@Singleton public class DefaultTokenEndpointClient extends java.lang.Object implements TokenEndpointClient
The default implementation ofTokenEndpointClient.- Since:
 - 1.2.0
 - Author:
 - James Kleeh
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultTokenEndpointClient(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.micronaut.http.client.RxHttpClientgetClient(java.lang.String providerName)Retrieves a client for the given provider.protected <G,R extends TokenResponse>
voidsecureRequest(io.micronaut.http.MutableHttpRequest<G> request, TokenRequestContext<G,R> requestContext)Secures the request according to the context's endpoint supported authentication methods.<G,R extends TokenResponse>
org.reactivestreams.Publisher<R>sendRequest(TokenRequestContext<G,R> requestContext) 
 - 
 
- 
- 
Constructor Detail
- 
DefaultTokenEndpointClient
public DefaultTokenEndpointClient(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration)- Parameters:
 beanContext- The bean contextdefaultClientConfiguration- The default client configuration
 
 - 
 
- 
Method Detail
- 
sendRequest
@Nonnull public <G,R extends TokenResponse> org.reactivestreams.Publisher<R> sendRequest(TokenRequestContext<G,R> requestContext)
- Specified by:
 sendRequestin interfaceTokenEndpointClient- Type Parameters:
 G- The token request grant or bodyR- 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 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 bodyR- The token response type- Parameters:
 request- Token endpoint RequestrequestContext- The request context
 
- 
getClient
protected io.micronaut.http.client.RxHttpClient getClient(java.lang.String providerName)
Retrieves a client for the given provider.- Parameters:
 providerName- The provider name- Returns:
 - An HTTP client to use to send the request
 
 
 - 
 
 -