public interface Authenticator
An Authenticator implementation is responsible for managing the user authentication process. This is a key concept of how authentication is performed by PicketLink.
During the authentication (eg.: Identity.login()) the Identity
will try to select the
proper authenticator based on the following premises:
.PicketLink
is provided, it will be used.PicketLink
that
references a implementation of this interface, it will be selected.Please, not that implementations must be annotated with PicketLink
,
otherwise they will not be recognized and selected during the authentication process.
If multiple implementations exists for the same application, only one should be annotated with
PicketLink
. If you want to use multiple authenticators and select them at
runtime based on a specific condition you can use a producer method annotated with this annotation.
In order to get a successful authentication attempt, considering that the implementation has successfully checked the provided credentials, implementations need to:
AuthenticationStatus.SUCCESS
status.Account
that maps to the owner of the provided credentials.The other status can be used in case of failure or if the authentication was deferred.
It is recommended that implementations be requested scoped.
Modifier and Type | Interface and Description |
---|---|
static class |
Authenticator.AuthenticationStatus |
Modifier and Type | Method and Description |
---|---|
void |
authenticate()
Performs the authentication.
|
Account |
getAccount()
Returns a
Account if a successful authentication was made. |
Authenticator.AuthenticationStatus |
getStatus()
Returns the current status of the authentication attempt.
|
void |
postAuthenticate()
Post-authentication logic.
|
void authenticate()
Performs the authentication.
void postAuthenticate()
Post-authentication logic. This method is always invoked after an authentication attempt.
Authenticator.AuthenticationStatus getStatus()
Returns the current status of the authentication attempt.
Copyright © 2018 JBoss by Red Hat. All rights reserved.