public class RestrictedAuthenticator extends Authenticator
| Modifier and Type | Class and Description |
|---|---|
static class |
RestrictedAuthenticator.Factory |
Authenticator.AuthenticatorFactory, Authenticator.LoginNotPermittedLOGGED_IN_TIMEOUT_INTERVAL, PRIVILEGED_TIMEOUT_INTERVAL| Constructor and Description |
|---|
RestrictedAuthenticator(javax.servlet.http.HttpServletRequest req,
Authenticator auth) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accountRequiresEditing(UserAccount userAccount)
Is a change in name or email required when the user logs in?
|
UserAccount |
getAccountForExternalAuth(String externalAuthId)
Get the UserAccount for this external ID, or null if there is none.
|
UserAccount |
getAccountForInternalAuth(String emailAddress)
Get the UserAccount for this email address, or null if there is none.
|
List<String> |
getAssociatedIndividualUris(UserAccount userAccount)
Get the URIs of all individuals associated with this user, whether by a
self-editing property like cornellEmailNetid, or by mayEditAs.
|
boolean |
isCurrentPassword(UserAccount userAccount,
String clearTextPassword)
Internal: does this UserAccount have this password? False if the
userAccount is null.
|
boolean |
isCurrentPasswordArgon2(UserAccount userAccount,
String clearTextPassword)
Does this UserAccount have this Argon2 password? False if the
userAccount is null.
|
boolean |
isUserPermittedToLogin(UserAccount userAccount)
Is this user permitted to login? Some Authenticators might disable logins
for certain users.
|
boolean |
md5HashIsNull(UserAccount userAccount)
Checks if the user still has got an MD5 Password
|
void |
recordLoginAgainstUserAccount(UserAccount userAccount,
LoginStatusBean.AuthenticationSource authSource)
Record that the user has logged in, with all of the housekeeping that
goes with it:
- update the user record
- set login status and timeout limit in the session
- refresh the Identifiers on the request
- record the user in the session map
- notify other users of the model
|
void |
recordNewPassword(UserAccount userAccount,
String newClearTextPassword)
Internal: record a new password for the user.
|
void |
recordUserIsLoggedOut()
Record that the current user has logged out: - notify other users of the
model.
|
String |
toString() |
applyArgon2iEncoding, applyMd5Encoding, getIdsForUserAccount, getInstance, isValidEmailAddress, setAuthenticatorFactory, verifyArgon2iHashpublic RestrictedAuthenticator(javax.servlet.http.HttpServletRequest req,
Authenticator auth)
public boolean isUserPermittedToLogin(UserAccount userAccount)
AuthenticatorisUserPermittedToLogin in class Authenticatorpublic void recordLoginAgainstUserAccount(UserAccount userAccount, LoginStatusBean.AuthenticationSource authSource) throws Authenticator.LoginNotPermitted
AuthenticatorRecord that the user has logged in, with all of the housekeeping that goes with it: - update the user record - set login status and timeout limit in the session - refresh the Identifiers on the request - record the user in the session map - notify other users of the model
recordLoginAgainstUserAccount in class AuthenticatorAuthenticator.LoginNotPermitted - if the Authenticator denies this user the ability to login.
This should be thrown if and only if isUserPermittedToLogin()
returns false.public UserAccount getAccountForExternalAuth(String externalAuthId)
AuthenticatorgetAccountForExternalAuth in class Authenticatorpublic UserAccount getAccountForInternalAuth(String emailAddress)
AuthenticatorgetAccountForInternalAuth in class Authenticatorpublic boolean md5HashIsNull(UserAccount userAccount)
Authenticatormd5HashIsNull in class Authenticatorpublic boolean isCurrentPasswordArgon2(UserAccount userAccount, String clearTextPassword)
AuthenticatorisCurrentPasswordArgon2 in class Authenticatorpublic boolean isCurrentPassword(UserAccount userAccount, String clearTextPassword)
AuthenticatorisCurrentPassword in class Authenticatorpublic void recordNewPassword(UserAccount userAccount, String newClearTextPassword)
AuthenticatorrecordNewPassword in class Authenticatorpublic boolean accountRequiresEditing(UserAccount userAccount)
AuthenticatoraccountRequiresEditing in class Authenticatorpublic List<String> getAssociatedIndividualUris(UserAccount userAccount)
AuthenticatorgetAssociatedIndividualUris in class Authenticatorpublic void recordUserIsLoggedOut()
AuthenticatorRecord that the current user has logged out: - notify other users of the model. - invalidate the session.
recordUserIsLoggedOut in class AuthenticatorCopyright © 2022. All rights reserved.