Package io.quarkus.security.identity
Interface IdentityProvider<T extends AuthenticationRequest>
-
public interface IdentityProvider<T extends AuthenticationRequest>As the requirements for different providers are often different this interface has purposefully been made minimal. Interfaces that extend IdentityProvider should be created for different use cases, which can then be used directly.
IdentityProviderManagershould be used to get a specific type ofIdentityProviderfor a specific use case.
-
-
Field Summary
Fields Modifier and Type Field Description static intSYSTEM_FIRSTThe highest priority provider Quarkus will registerstatic intSYSTEM_LASTThe lowest priority provider Quarkus will register
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<SecurityIdentity>authenticate(T request, AuthenticationRequestContext context)Attempts to authenticate the given authentication request.Class<T>getRequestType()default intpriority()Returns the priority of this identity provider.
-
-
-
Field Detail
-
SYSTEM_LAST
static final int SYSTEM_LAST
The lowest priority provider Quarkus will register- See Also:
- Constant Field Values
-
SYSTEM_FIRST
static final int SYSTEM_FIRST
The highest priority provider Quarkus will register- See Also:
- Constant Field Values
-
-
Method Detail
-
authenticate
io.smallrye.mutiny.Uni<SecurityIdentity> authenticate(T request, AuthenticationRequestContext context)
Attempts to authenticate the given authentication request. If this is unsuccessful because the provided credentials are invalid then this should fail with anAuthenticationFailedException, otherwise it should complete with a null value.Any other failure mode will be interpreted as a failure in the underlying store (e.g. LDAP is down), rather than the credentials being invalid. If multiple providers are installed that can handle the same type of request an
AuthenticationFailedExceptionwill immediately stop processing, while any other failure will allow processing to continue.- Parameters:
request- The authentication requestcontext- The context of the request- Returns:
- The future security identity
-
priority
default int priority()
Returns the priority of this identity provider. System providers have a priority between 0 and 1000 by default, so to guarantee that your provider runs before the Quarkus ones it's priority should be over 1000.- Returns:
- The priority of this identity provider
-
-