Class AbstractUserService

java.lang.Object
com.atlassian.crowd.service.AbstractUserService
All Implemented Interfaces:
UserService
Direct Known Subclasses:
UserServiceImpl

public abstract class AbstractUserService extends Object implements UserService
  • Field Details

  • Constructor Details

  • Method Details

    • getAuthenticatedUsername

      @Nullable public String getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
      Description copied from interface: UserService
      Returns the username of the currently logged in user or null if no user can be found.
      Specified by:
      getAuthenticatedUsername in interface UserService
      Parameters:
      request - The request to retrieve the username from
      Returns:
      The user name of the logged in user or null
    • isUserInGroup

      public boolean isUserInGroup(String username, String group)
      Description copied from interface: UserService
      Returns whether the user is in the specify group
      Specified by:
      isUserInGroup in interface UserService
      Parameters:
      username - The username to check
      group - The group to check
      Returns:
      True if the user is in the specified group
    • isSystemAdmin

      public boolean isSystemAdmin(@Nullable String username)
      Description copied from interface: UserService
      Returns true or false depending on if a user has been granted the sysAdmin permission within Crowd.
      Specified by:
      isSystemAdmin in interface UserService
      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

      public boolean authenticate(String username, String password)
      Description copied from interface: UserService
      Given a username and password, this method checks, whether or not the provided user can be authenticated
      Specified by:
      authenticate in interface UserService
      Parameters:
      username - Username of the user
      password - Password of the user
      Returns:
      True if the user can be authenticated, false otherwise
    • resolve

      public abstract Principal resolve(String username)
      Description copied from interface: UserService
      Returns the user that made this request or null if this application does not have such a user.
      Specified by:
      resolve in interface UserService
      Parameters:
      username - Username of the user a consumer is making a request on behalf of
      Returns:
      Principal corresponding to the username, null if the user does not exist
    • setAuthenticatedUser

      public abstract boolean setAuthenticatedUser(String username)
      Description copied from interface: UserService
      Authenticate 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:
      setAuthenticatedUser in interface UserService
      Parameters:
      username - the username of the user to authenticate
      Returns:
      true if the username was correctly resolved and authenticated, false otherwise