Class OauthPasswordAuthenticationProvider
- java.lang.Object
-
- io.micronaut.security.oauth2.endpoint.token.request.password.OauthPasswordAuthenticationProvider
-
- All Implemented Interfaces:
AuthenticationProvider
public class OauthPasswordAuthenticationProvider extends java.lang.Object implements AuthenticationProvider
AnAuthenticationProviderthat delegates to an OAuth 2.0 provider using the password grant flow.- Since:
- 1.2.0
- Author:
- Sergio del Amo
-
-
Constructor Summary
Constructors Constructor Description OauthPasswordAuthenticationProvider(TokenEndpointClient tokenEndpointClient, OauthClientConfiguration clientConfiguration, OauthUserDetailsMapper userDetailsMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.reactivestreams.Publisher<AuthenticationResponse>authenticate(AuthenticationRequest authenticationRequest)Authenticates a user with the given request.protected SecureEndpointgetTokenEndpoint(OauthClientConfiguration clientConfiguration)Builds the secure endpoint from the client configuration
-
-
-
Constructor Detail
-
OauthPasswordAuthenticationProvider
public OauthPasswordAuthenticationProvider(TokenEndpointClient tokenEndpointClient, OauthClientConfiguration clientConfiguration, OauthUserDetailsMapper userDetailsMapper)
- Parameters:
tokenEndpointClient- The token endpoint clientclientConfiguration- The client configurationuserDetailsMapper- The user details mapper
-
-
Method Detail
-
authenticate
public org.reactivestreams.Publisher<AuthenticationResponse> authenticate(AuthenticationRequest authenticationRequest)
Description copied from interface:AuthenticationProviderAuthenticates a user with the given request. If a successful authentication is returned, the object must be an instance ofUserDetails.- Specified by:
authenticatein interfaceAuthenticationProvider- Parameters:
authenticationRequest- The request to authenticate- Returns:
- A publisher that emits 0 or 1 responses
-
getTokenEndpoint
protected SecureEndpoint getTokenEndpoint(OauthClientConfiguration clientConfiguration)
Builds the secure endpoint from the client configuration- Parameters:
clientConfiguration- The client configuration- Returns:
- The token endpoint
-
-