@NotThreadSafe public final class AppLoginModule extends Object implements LoginModule
Modifier and Type | Class and Description |
---|---|
static class |
AppLoginModule.AppCallbackHandler
A callback handler for
AppLoginModule . |
Constructor and Description |
---|
AppLoginModule()
Constructs a new
AppLoginModule . |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
Aborts the authentication (second phase).
|
boolean |
commit()
Commits the authentication (second phase).
|
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) |
boolean |
login()
Retrieves the user name by querying the property of
PropertyKey.SECURITY_LOGIN_USERNAME through AppLoginModule.AppCallbackHandler . |
boolean |
logout()
Logs out the user
|
public AppLoginModule()
AppLoginModule
.public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
initialize
in interface LoginModule
public boolean login() throws LoginException
PropertyKey.SECURITY_LOGIN_USERNAME
through AppLoginModule.AppCallbackHandler
.login
in interface LoginModule
LoginException
- when the login failspublic boolean abort() throws LoginException
This method is called if the LoginContext's overall authentication failed. (login failed) It cleans up any state that was changed in the login and commit methods.
abort
in interface LoginModule
LoginException
- when the abortion failspublic boolean commit() throws LoginException
This method is called if the LoginContext's overall authentication succeeded. The implementation first checks if there is already Alluxio user in the subject. If not, it adds the previously logged in Alluxio user into the subject.
commit
in interface LoginModule
LoginException
- not Alluxio user is found or createdpublic boolean logout() throws LoginException
The implementation removes the User associated with the Subject.
logout
in interface LoginModule
LoginException
- if logout failsCopyright © 2023. All Rights Reserved.