Class ReactiveOpenIdPasswordAuthenticationProvider<T,I,S>
java.lang.Object
io.micronaut.security.oauth2.endpoint.token.request.password.ReactiveOpenIdPasswordAuthenticationProvider<T,I,S>
- Type Parameters:
T
- Request Context TypeI
- Authentication Request Identity TypeS
- Authentication Request Secret Type
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,ReactiveAuthenticationProvider<T,
I, S>
public class ReactiveOpenIdPasswordAuthenticationProvider<T,I,S>
extends Object
implements ReactiveAuthenticationProvider<T,I,S>
An
ReactiveAuthenticationProvider
that delegates to an OpenID provider using the
password grant flow.- Since:
- 4.8.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionReactiveOpenIdPasswordAuthenticationProvider
(OauthClientConfiguration clientConfiguration, OpenIdProviderMetadata openIdProviderMetadata, TokenEndpointClient tokenEndpointClient, OpenIdAuthenticationMapper openIdAuthenticationMapper, ReactiveOpenIdTokenResponseValidator<com.nimbusds.jwt.JWT> tokenResponseValidator) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<AuthenticationResponse>
authenticate
(T requestContext, AuthenticationRequest<I, S> authenticationRequest) Authenticates a user with the given request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
Methods inherited from interface io.micronaut.security.authentication.provider.ReactiveAuthenticationProvider
authenticate
-
Constructor Details
-
ReactiveOpenIdPasswordAuthenticationProvider
public ReactiveOpenIdPasswordAuthenticationProvider(OauthClientConfiguration clientConfiguration, OpenIdProviderMetadata openIdProviderMetadata, TokenEndpointClient tokenEndpointClient, OpenIdAuthenticationMapper openIdAuthenticationMapper, ReactiveOpenIdTokenResponseValidator<com.nimbusds.jwt.JWT> tokenResponseValidator) - Parameters:
clientConfiguration
- The client configurationopenIdProviderMetadata
- The provider metadatatokenEndpointClient
- The token endpoint clientopenIdAuthenticationMapper
- The user details mappertokenResponseValidator
- The token response validator
-
-
Method Details
-
authenticate
public org.reactivestreams.Publisher<AuthenticationResponse> authenticate(T requestContext, AuthenticationRequest<I, S> authenticationRequest) Description copied from interface:ReactiveAuthenticationProvider
Authenticates 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:
authenticate
in interfaceReactiveAuthenticationProvider<T,
I, S> - Parameters:
requestContext
- rquest context (it may be an HTTP request).authenticationRequest
- The credentials to authenticate- Returns:
- A publisher that emits 0 or 1 responses
-