Interface AuthenticationProvider<T,I,S>

Type Parameters:
T - Request Context Type
I - Authentication Request Identity Type
S - Authentication Request Secret Type
All Superinterfaces:
io.micronaut.core.order.Ordered
All Known Subinterfaces:
ExecutorAuthenticationProvider<T,I,S>, HttpRequestAuthenticationProvider<B>, HttpRequestExecutorAuthenticationProvider<B>
All Known Implementing Classes:
LdapAuthenticationProvider

@Indexed(AuthenticationProvider.class) public interface AuthenticationProvider<T,I,S> extends io.micronaut.core.order.Ordered
Defines an API to authenticate a user with the given request.
Since:
4.5.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NonNull AuthenticationResponse
    authenticate(@NonNull AuthenticationRequest<I,S> authRequest)
    Authenticates a user with the given request.
    authenticate(T requestContext, @NonNull AuthenticationRequest<I,S> authRequest)
    Authenticates a user with the given request.

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Method Details

    • authenticate

      @NonNull @Executable @NonNull AuthenticationResponse authenticate(@Nullable T requestContext, @NonNull @NonNull AuthenticationRequest<I,S> authRequest)
      Authenticates a user with the given request. If authenticated successfully return AuthenticationResponse.success(String). If not authenticated return AuthenticationResponse.failure(). If your implementation is blocking, annotate the overriden method with Blocking and it will be safely executed on a dedicated thread in order to not block the main reactive chain of execution.
      Parameters:
      requestContext - The context request (typically an HTTP Request).
      authRequest - The credentials to authenticate
      Returns:
      An AuthenticationResponse indicating either success or failure.
    • authenticate

      @NonNull @Executable default @NonNull AuthenticationResponse authenticate(@NonNull @NonNull AuthenticationRequest<I,S> authRequest)
      Authenticates a user with the given request. If authenticated successfully return AuthenticationResponse.success(String). If not authenticated return AuthenticationResponse.failure(). If your implementation is blocking, annotate the overriden method with Blocking and it will be safely executed on a dedicated thread in order to not block the main reactive chain of execution.
      Parameters:
      authRequest - The credentials to authenticate
      Returns:
      An AuthenticationResponse indicating either success or failure.