Class OauthPasswordAuthenticationProvider
java.lang.Object
io.micronaut.security.oauth2.endpoint.token.request.password.OauthPasswordAuthenticationProvider
- All Implemented Interfaces:
 AuthenticationProvider
An 
AuthenticationProvider that delegates to an OAuth 2.0 provider using the
 password grant flow.- Since:
 - 1.2.0
 - Author:
 - Sergio del Amo
 
- 
Constructor Summary
ConstructorsConstructorDescriptionOauthPasswordAuthenticationProvider(TokenEndpointClient tokenEndpointClient, OauthClientConfiguration clientConfiguration, OauthAuthenticationMapper authenticationMapper)  - 
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<AuthenticationResponse>authenticate(io.micronaut.http.HttpRequest<?> httpRequest, AuthenticationRequest<?, ?> authenticationRequest) Authenticates a user with the given request.protected SecureEndpointgetTokenEndpoint(OauthClientConfiguration clientConfiguration) Builds the secure endpoint from the client configuration. 
- 
Constructor Details
- 
OauthPasswordAuthenticationProvider
public OauthPasswordAuthenticationProvider(TokenEndpointClient tokenEndpointClient, OauthClientConfiguration clientConfiguration, OauthAuthenticationMapper authenticationMapper) - Parameters:
 tokenEndpointClient- The token endpoint clientclientConfiguration- The client configurationauthenticationMapper- The user details mapper
 
 - 
 - 
Method Details
- 
authenticate
public org.reactivestreams.Publisher<AuthenticationResponse> authenticate(io.micronaut.http.HttpRequest<?> httpRequest, 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 ofAuthentication. Publishers MUST emit cold observables! This method will be called for all authenticators for each authentication request and it is assumed no work will be done until the publisher is subscribed to.- Specified by:
 authenticatein interfaceAuthenticationProvider- Parameters:
 httpRequest- The http requestauthenticationRequest- The credentials to authenticate- Returns:
 - A publisher that emits 0 or 1 responses
 
 - 
getTokenEndpoint
Builds the secure endpoint from the client configuration.- Parameters:
 clientConfiguration- The client configuration- Returns:
 - The token endpoint
 
 
 -