Class Authenticator<T>

java.lang.Object
io.micronaut.security.authentication.Authenticator<T>
Type Parameters:
T - Request Context Type

@Singleton public class Authenticator<T> extends Object
An Authenticator operates on several ReactiveAuthenticationProvider instances returning the first authenticated AuthenticationResponse.
Since:
1.0
Author:
Sergio del Amo, Graeme Rocher
  • Constructor Details

    • Authenticator

      public Authenticator(io.micronaut.context.BeanContext beanContext, List<ReactiveAuthenticationProvider<T,?,?>> reactiveAuthenticationProviders, List<AuthenticationProvider<T,?,?>> authenticationProviders, SecurityConfiguration securityConfiguration)
      Parameters:
      beanContext - Bean Context
      reactiveAuthenticationProviders - A list of available Reactive authentication providers
      authenticationProviders - A list of available imperative authentication providers
      securityConfiguration - 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 request
      authenticationRequest - Represents a request to authenticate.
      Returns:
      A publisher that emits AuthenticationResponse objects
    • isImperativeAuthenticationProviderIsBlocking

      protected boolean isImperativeAuthenticationProviderIsBlocking(AuthenticationProvider<?,?,?> authenticationProvider)
      If ExecutorAuthenticationProvider.getExecutorName() equals `blocking` or `io` returns `true`.
      Parameters:
      authenticationProvider - An authentication provider
      Returns:
      Whether any of the authentication provider is blocking.