Interface LoginService
- All Known Implementing Classes:
LoginServiceImpl
@PublicApi
public interface LoginService
The LoginService keeps track of users login activities.
- Since:
- v4.0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis is set into the the request for the last login result -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(ApplicationUser user, String password) This can be called to see if a user knows the given password.getLoginInfo(String userName) This is called to get LoginInfo about a given user.getLoginProperties(ApplicationUser remoteUser, jakarta.servlet.http.HttpServletRequest request) Returns loginProperties needed to render the login gadget or login form.booleanvoidlogout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Log out of JIRAvoidThis can be called to reset the failed login count of a userThis can be called to update the user's last login time upon a successful login.
-
Field Details
-
LOGIN_RESULT
This is set into the the request for the last login result- See Also:
-
-
Method Details
-
getLoginInfo
This is called to get LoginInfo about a given user.- Parameters:
userName- the name of the user in play. This MUST not be null.- Returns:
- a
LoginInfoobject
-
isElevatedSecurityCheckAlwaysShown
boolean isElevatedSecurityCheckAlwaysShown()- Returns:
- true if the elevated security check (such as CAPTCHA) is always shown
-
resetFailedLoginCount
This can be called to reset the failed login count of a user- Parameters:
user- the user to authorise. This MUST not be null.
-
updateLastLoginTime
This can be called to update the user's last login time upon a successful login.- Parameters:
user- the user who will have their last login time updated- Returns:
- an object containing the user's login history
-
authenticate
This can be called to see if a user knows the given password.If the user requests elevatedSecurity then this will always fail with LoginReason.AUTHENTICATION_DENIED
- Parameters:
user- the user to authenticate. This MUST not be null.password- the password to authenticate against- Returns:
- true if the user can be authenticated
-
logout
void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Log out of JIRA- Parameters:
request- the current servlet requestresponse- the current servlet response
-
getLoginProperties
LoginProperties getLoginProperties(ApplicationUser remoteUser, jakarta.servlet.http.HttpServletRequest request) Returns loginProperties needed to render the login gadget or login form.- Parameters:
remoteUser- the currently logged in userrequest- the incoming http request which may contain user credentials- Returns:
- LoginProperties with information to render the login gadget/form
-