Interface UserService

All Known Implementing Classes:
AbstractUserService, UserServiceImpl

public interface UserService
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    authenticate(String username, String password)
    Given a username and password, this method checks, whether or not the provided user can be authenticated
    getAuthenticatedUsername(javax.servlet.http.HttpServletRequest request)
    Returns the username of the currently logged in user or null if no user can be found.
    boolean
    Returns true or false depending on if a user has been granted the sysAdmin permission within Crowd.
    boolean
    isUserInGroup(String username, String group)
    Returns whether the user is in the specify group
    resolve(String username)
    Returns the user that made this request or null if this application does not have such a user.
    boolean
    Authenticate the current user by setting an appropriate authentication token in Spring Security's SecurityContext.
  • Method Details

    • getAuthenticatedUsername

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

      boolean isUserInGroup(String username, String group)
      Returns whether the user is in the specify group
      Parameters:
      username - The username to check
      group - The group to check
      Returns:
      True if the user is in the specified group
    • isSystemAdmin

      boolean isSystemAdmin(@Nullable String username)
      Returns true or false depending on if a user has been granted the sysAdmin permission within Crowd.
      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

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

      Principal resolve(String username) throws CrowdRuntimeException
      Returns the user that made this request or null if this application does not have such a user.
      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
      Throws:
      CrowdRuntimeException - if there was an error retrieving the username
    • setAuthenticatedUser

      boolean setAuthenticatedUser(String username)
      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).
      Parameters:
      username - the username of the user to authenticate
      Returns:
      true if the username was correctly resolved and authenticated, false otherwise