Interface AuthenticationProvider<T,I,S>
- Type Parameters:
T
- Request Context TypeI
- Authentication Request Identity TypeS
- Authentication Request Secret Type
- All Superinterfaces:
io.micronaut.core.order.Ordered
- All Known Subinterfaces:
ExecutorAuthenticationProvider<T,
,I, S> HttpRequestAuthenticationProvider<B>
,HttpRequestExecutorAuthenticationProvider<B>
@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 TypeMethodDescriptiondefault @NonNull AuthenticationResponse
authenticate
(@NonNull AuthenticationRequest<I, S> authRequest) Authenticates a user with the given request.@NonNull AuthenticationResponse
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 returnAuthenticationResponse.success(String)
. If not authenticated returnAuthenticationResponse.failure()
. If your implementation is blocking, annotate the overriden method withBlocking
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 returnAuthenticationResponse.success(String)
. If not authenticated returnAuthenticationResponse.failure()
. If your implementation is blocking, annotate the overriden method withBlocking
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.
-