Class Authenticator<T>
java.lang.Object
io.micronaut.security.authentication.Authenticator<T>
- Type Parameters:
T
- Request Context Type
An Authenticator operates on several
ReactiveAuthenticationProvider
instances returning the first
authenticated AuthenticationResponse
.- Since:
- 1.0
- Author:
- Sergio del Amo, Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Collection<AuthenticationProvider<T>>
Deprecated, for removal: This API element is subject to removal in a future version.Unused. -
Constructor Summary
ConstructorDescriptionAuthenticator
(io.micronaut.context.BeanContext beanContext, List<ReactiveAuthenticationProvider<T, ?, ?>> reactiveAuthenticationProviders, List<AuthenticationProvider<T, ?, ?>> authenticationProviders, SecurityConfiguration securityConfiguration) Deprecated.Authenticator
(io.micronaut.context.BeanContext beanContext, List<ReactiveAuthenticationProvider<T, ?, ?>> reactiveAuthenticationProviders, List<AuthenticationProvider<T, ?, ?>> authenticationProviders, List<AuthenticationProvider<T>> deprecatedAuthenticationProviders, SecurityConfiguration securityConfiguration) Authenticator
(Collection<AuthenticationProvider<T>> deprecatedAuthenticationProviders, SecurityConfiguration securityConfiguration) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<AuthenticationResponse>
authenticate
(T requestContext, AuthenticationRequest<?, ?> authenticationRequest) Authenticates the user with the provided credentials.protected boolean
isImperativeAuthenticationProviderIsBlocking
(AuthenticationProvider<?, ?, ?> authenticationProvider) IfExecutorAuthenticationProvider.getExecutorName()
equals `blocking` or `io` returns `true`.
-
Field Details
-
authenticationProviders
@Deprecated(forRemoval=true, since="4.5.0") protected final Collection<AuthenticationProvider<T>> authenticationProvidersDeprecated, for removal: This API element is subject to removal in a future version.Unused. To be removed in the next major version.
-
-
Constructor Details
-
Authenticator
@Inject public Authenticator(io.micronaut.context.BeanContext beanContext, List<ReactiveAuthenticationProvider<T, ?, ?>> reactiveAuthenticationProviders, List<AuthenticationProvider<T, ?, ?>> authenticationProviders, List<AuthenticationProvider<T>> deprecatedAuthenticationProviders, SecurityConfiguration securityConfiguration) - Parameters:
beanContext
- Bean ContextreactiveAuthenticationProviders
- A list of available Reactive authentication providersauthenticationProviders
- A list of available imperative authentication providersdeprecatedAuthenticationProviders
- A list of available deprecated authentication providerssecurityConfiguration
- The security configuration
-
Authenticator
public Authenticator(io.micronaut.context.BeanContext beanContext, List<ReactiveAuthenticationProvider<T, ?, ?>> reactiveAuthenticationProviders, List<AuthenticationProvider<T, ?, ?>> authenticationProviders, SecurityConfiguration securityConfiguration) Deprecated.- Parameters:
beanContext
- Bean ContextreactiveAuthenticationProviders
- A list of available Reactive authentication providersauthenticationProviders
- A list of available imperative authentication providerssecurityConfiguration
- The security configuration
-
Authenticator
@Deprecated(forRemoval=true, since="4.5.0") public Authenticator(Collection<AuthenticationProvider<T>> deprecatedAuthenticationProviders, SecurityConfiguration securityConfiguration) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
deprecatedAuthenticationProviders
- A list of available authentication providerssecurityConfiguration
- The security configuration
-
-
Method Details
-
authenticate
public org.reactivestreams.Publisher<AuthenticationResponse> authenticate(T requestContext, AuthenticationRequest<?, ?> authenticationRequest) Authenticates the user with the provided credentials.- Parameters:
requestContext
- The HTTP requestauthenticationRequest
- Represents a request to authenticate.- Returns:
- A publisher that emits
AuthenticationResponse
objects
-
isImperativeAuthenticationProviderIsBlocking
protected boolean isImperativeAuthenticationProviderIsBlocking(AuthenticationProvider<?, ?, ?> authenticationProvider) IfExecutorAuthenticationProvider.getExecutorName()
equals `blocking` or `io` returns `true`.- Parameters:
authenticationProvider
- An authentication provider- Returns:
- Whether any of the authentication provider is blocking.
-