Class DefaultOpenIdClient
java.lang.Object
io.micronaut.security.oauth2.client.DefaultOpenIdClient
- All Implemented Interfaces:
- OauthClient,- OpenIdClient
The default implementation of 
OpenIdClient.- Since:
- 1.2.0
- Author:
- James Kleeh
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultOpenIdClient(OauthClientConfiguration clientConfiguration, Supplier<OpenIdProviderMetadata> openIdProviderMetadata, @Nullable OpenIdAuthenticationMapper authenticationMapper, AuthorizationRedirectHandler redirectUrlBuilder, OpenIdAuthorizationResponseHandler authorizationResponseHandler, io.micronaut.context.BeanContext beanContext, @Nullable EndSessionEndpoint endSessionEndpoint) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>>authorizationRedirect(io.micronaut.http.HttpRequest<?> originating) Responsible for redirecting to the authorization endpoint.Optional<io.micronaut.http.MutableHttpResponse<?>>endSessionRedirect(io.micronaut.http.HttpRequest<?> request, Authentication authentication) Redirects to the end session endpoint of an OpenID provider.getName()protected SecureEndpointprotected booleanisErrorCallback(io.micronaut.core.convert.value.ConvertibleMultiValues<String> responseData) org.reactivestreams.Publisher<AuthenticationResponse>onCallback(io.micronaut.http.HttpRequest<Map<String, Object>> request) Responsible for receiving the authorization callback request and returning an authentication response.boolean
- 
Constructor Details- 
DefaultOpenIdClientpublic DefaultOpenIdClient(OauthClientConfiguration clientConfiguration, Supplier<OpenIdProviderMetadata> openIdProviderMetadata, @Nullable @Nullable OpenIdAuthenticationMapper authenticationMapper, AuthorizationRedirectHandler redirectUrlBuilder, OpenIdAuthorizationResponseHandler authorizationResponseHandler, io.micronaut.context.BeanContext beanContext, @Nullable @Nullable EndSessionEndpoint endSessionEndpoint) - Parameters:
- clientConfiguration- The client configuration
- openIdProviderMetadata- The provider metadata
- authenticationMapper- The user details mapper
- redirectUrlBuilder- The redirect URL builder
- authorizationResponseHandler- The authorization response handler
- beanContext- The bean context
- endSessionEndpoint- The end session request
 
 
- 
- 
Method Details- 
getName- Specified by:
- getNamein interface- OauthClient
- Returns:
- The provider name
 
- 
supportsEndSessionpublic boolean supportsEndSession()- Specified by:
- supportsEndSessionin interface- OpenIdClient
- Returns:
- True if this client supports end session
 
- 
endSessionRedirectpublic Optional<io.micronaut.http.MutableHttpResponse<?>> endSessionRedirect(io.micronaut.http.HttpRequest<?> request, Authentication authentication) Description copied from interface:OpenIdClientRedirects to the end session endpoint of an OpenID provider. Returns an empty optional if the provider does not support end session or anEndSessionEndpointcould not be resolved for the provider.- Specified by:
- endSessionRedirectin interface- OpenIdClient
- Parameters:
- request- The current request
- authentication- The current authentication
- Returns:
- An optional response
 
- 
authorizationRedirectpublic org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> authorizationRedirect(io.micronaut.http.HttpRequest<?> originating) Description copied from interface:OauthClientResponsible for redirecting to the authorization endpoint.- Specified by:
- authorizationRedirectin interface- OauthClient
- Parameters:
- originating- The originating request
- Returns:
- A response publisher
 
- 
onCallbackpublic org.reactivestreams.Publisher<AuthenticationResponse> onCallback(io.micronaut.http.HttpRequest<Map<String, Object>> request) Description copied from interface:OauthClientResponsible for receiving the authorization callback request and returning an authentication response.- Specified by:
- onCallbackin interface- OauthClient
- Parameters:
- request- The callback request
- Returns:
- The authentication response
 
- 
isErrorCallbackprotected boolean isErrorCallback(io.micronaut.core.convert.value.ConvertibleMultiValues<String> responseData) - Parameters:
- responseData- The response data
- Returns:
- True if the response indicates an error occurred.
 
- 
getTokenEndpoint- Returns:
- The token endpoint
 
 
-