Interface LoginManager
-
- All Known Implementing Classes:
DefaultLoginManager
public interface LoginManagerThe LoginManager keeps track of users login activities.- Since:
- 3.2.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LoginResultauthenticate(String userName, String password)Try to authenticate a user given theuserNameandpassword.@Nullable LoginInfogetLoginInfo(com.atlassian.user.User user)Return information about a user's login history.@Nullable LoginInfogetLoginInfo(String userName)Return information about a user's login history.booleanisElevatedSecurityCheckEnabled()Check if elevated security checks are available/enabled.voidonFailedLoginAttempt(String userName, javax.servlet.http.HttpServletRequest servletRequest)This is called after an unsuccessful login attempt has been made.voidonSuccessfulLoginAttempt(String userName, javax.servlet.http.HttpServletRequest servletRequest)This is called after a successful login attempt has been made.booleanrequiresElevatedSecurityCheck(String userName)This is called to see whether the user requires an extended security check (such as CAPTCHA)voidresetFailedLoginCount(com.atlassian.user.User user)This can be called to reset the failed login count of a user
-
-
-
Method Detail
-
authenticate
LoginResult authenticate(String userName, String password)
Try to authenticate a user given theuserNameandpassword.Returns a
LoginResultthat contains information about this particular authentication attempt.Calling this method has side effects as the login manager tracks the number of failed and successful login attempts.
- Parameters:
userName-password-- Returns:
- The result of the authentication attempt, this will never be null.
-
getLoginInfo
@Nullable LoginInfo getLoginInfo(String userName)
Return information about a user's login history.- Parameters:
userName-- Returns:
- LoginInfo
-
getLoginInfo
@Nullable LoginInfo getLoginInfo(com.atlassian.user.User user)
Return information about a user's login history.- Parameters:
user-- Returns:
- LoginInfo
-
requiresElevatedSecurityCheck
boolean requiresElevatedSecurityCheck(String userName)
This is called to see whether the user requires an extended security check (such as CAPTCHA)- Parameters:
userName- the name of the user in play. This MUST not be null.- Returns:
- true if the user with the user name
userNamerequires an extended security check
-
isElevatedSecurityCheckEnabled
boolean isElevatedSecurityCheckEnabled()
Check if elevated security checks are available/enabled.- Returns:
- true if elevated security checks are enabled, false otherwise
-
onFailedLoginAttempt
void onFailedLoginAttempt(String userName, javax.servlet.http.HttpServletRequest servletRequest)
This is called after an unsuccessful login attempt has been made. It allows the LoginManager to update information about a users login history.- Parameters:
userName- the name of the user in play. This MUST not be null.servletRequest- the request pertaining to a login attempt.
-
onSuccessfulLoginAttempt
void onSuccessfulLoginAttempt(String userName, javax.servlet.http.HttpServletRequest servletRequest)
This is called after a successful login attempt has been made. It allows the LoginManager to update information about a users login history.- Parameters:
userName- the name of the user in play. This MUST not be null.servletRequest- the request pertaining to a login attempt.
-
resetFailedLoginCount
void resetFailedLoginCount(com.atlassian.user.User user)
This can be called to reset the failed login count of a user- Parameters:
user- the user for which to reset the failed login count. This MUST not be null.
-
-