Package com.atlassian.crowd.service
Class AbstractUserService
java.lang.Object
com.atlassian.crowd.service.AbstractUserService
- All Implemented Interfaces:
UserService
- Direct Known Subclasses:
UserServiceImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ApplicationServiceprotected final AuthenticatedUserProviderprotected final InternalApplicationHelperprotected final TokenAuthenticationManagerprotected final UserPermissionService -
Constructor Summary
ConstructorsConstructorDescriptionAbstractUserService(InternalApplicationHelper internalApplicationHelper, ApplicationService applicationService, TokenAuthenticationManager tokenAuthenticationManager, UserPermissionService userPermissionService, AuthenticatedUserProvider authenticatedUserProvider) -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(String username, String password) Given a username and password, this method checks, whether or not the provided user can be authenticatedgetAuthenticatedUsername(javax.servlet.http.HttpServletRequest request) Returns the username of the currently logged in user or null if no user can be found.booleanisSystemAdmin(String username) Returns true or false depending on if a user has been granted the sysAdmin permission within Crowd.booleanisUserInGroup(String username, String group) Returns whether the user is in the specify groupabstract PrincipalReturns the user that made this request ornullif this application does not have such a user.abstract booleansetAuthenticatedUser(String username) Authenticate the current user by setting an appropriate authentication token in Spring Security's SecurityContext.
-
Field Details
-
internalApplicationHelper
-
applicationService
-
tokenAuthenticationManager
-
userPermissionService
-
authenticatedUserProvider
-
-
Constructor Details
-
AbstractUserService
public AbstractUserService(InternalApplicationHelper internalApplicationHelper, ApplicationService applicationService, TokenAuthenticationManager tokenAuthenticationManager, UserPermissionService userPermissionService, AuthenticatedUserProvider authenticatedUserProvider)
-
-
Method Details
-
getAuthenticatedUsername
Description copied from interface:UserServiceReturns the username of the currently logged in user or null if no user can be found.- Specified by:
getAuthenticatedUsernamein interfaceUserService- Parameters:
request- The request to retrieve the username from- Returns:
- The user name of the logged in user or null
-
isUserInGroup
Description copied from interface:UserServiceReturns whether the user is in the specify group- Specified by:
isUserInGroupin interfaceUserService- Parameters:
username- The username to checkgroup- The group to check- Returns:
- True if the user is in the specified group
-
isSystemAdmin
Description copied from interface:UserServiceReturns true or false depending on if a user has been granted the sysAdmin permission within Crowd.- Specified by:
isSystemAdminin interfaceUserService- Parameters:
username- The username of the user to check- Returns:
- true or false depending on if a user has been granted the system admin permission.
-
authenticate
Description copied from interface:UserServiceGiven a username and password, this method checks, whether or not the provided user can be authenticated- Specified by:
authenticatein interfaceUserService- Parameters:
username- Username of the userpassword- Password of the user- Returns:
- True if the user can be authenticated, false otherwise
-
resolve
Description copied from interface:UserServiceReturns the user that made this request ornullif this application does not have such a user.- Specified by:
resolvein interfaceUserService- Parameters:
username- Username of the user a consumer is making a request on behalf of- Returns:
Principalcorresponding to the username,nullif the user does not exist
-
setAuthenticatedUser
Description copied from interface:UserServiceAuthenticate the current user by setting an appropriate authentication token in Spring Security's SecurityContext. This method should only be called if the user has been authenticated via some other mean (e.g OAuth or Trusted Apps).- Specified by:
setAuthenticatedUserin interfaceUserService- Parameters:
username- the username of the user to authenticate- Returns:
- true if the username was correctly resolved and authenticated, false otherwise
-