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 java.lang.Object implements OauthClient
The default implementation ofOauthClient.- Since:
- 1.2.0
-
-
Constructor Summary
Constructors Constructor Description DefaultOauthClient(OauthAuthenticationMapper authenticationMapper, OauthClientConfiguration clientConfiguration, AuthorizationRedirectHandler redirectHandler, OauthAuthorizationResponseHandler authorizationResponseHandler, io.micronaut.context.BeanContext beanContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>>authorizationRedirect(io.micronaut.http.HttpRequest<?> originating)Responsible for redirecting to the authorization endpoint.java.lang.StringgetName()protected booleanisErrorCallback(io.micronaut.core.convert.value.ConvertibleMultiValues<java.lang.String> responseData)org.reactivestreams.Publisher<io.micronaut.security.authentication.AuthenticationResponse>onCallback(io.micronaut.http.HttpRequest<java.util.Map<java.lang.String,java.lang.Object>> request)Responsible for receiving the authorization callback request and returning an authentication response.
-
-
-
Constructor Detail
-
DefaultOauthClient
public DefaultOauthClient(@Parameter OauthAuthenticationMapper authenticationMapper, @Parameter OauthClientConfiguration clientConfiguration, AuthorizationRedirectHandler redirectHandler, OauthAuthorizationResponseHandler authorizationResponseHandler, io.micronaut.context.BeanContext beanContext)- Parameters:
clientConfiguration- The client configurationauthenticationMapper- The user details mapperredirectHandler- The redirect URL builderauthorizationResponseHandler- The authorization response handlerbeanContext- The bean context
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceOauthClient- Returns:
- The provider name
-
authorizationRedirect
public 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 interfaceOauthClient- Parameters:
originating- The originating request- Returns:
- A response publisher
-
onCallback
public org.reactivestreams.Publisher<io.micronaut.security.authentication.AuthenticationResponse> onCallback(io.micronaut.http.HttpRequest<java.util.Map<java.lang.String,java.lang.Object>> request)
Description copied from interface:OauthClientResponsible for receiving the authorization callback request and returning an authentication response.- Specified by:
onCallbackin interfaceOauthClient- 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.
-
-