Class AuthenticatedUserUtil

java.lang.Object
com.atlassian.crowd.plugin.rest.service.util.RestAuthSessionHelperUtil
com.atlassian.crowd.plugin.rest.service.util.AuthenticatedUserUtil

public class AuthenticatedUserUtil extends RestAuthSessionHelperUtil
Utility for setting and retrieving the authenticated user's name from the HttpServletRequest.
Since:
v2.1
  • Field Details

  • Method Details

    • getAuthenticatedUser

      @Nullable public static String getAuthenticatedUser(javax.servlet.http.HttpServletRequest request)
      Returns the username from the HttpSession, or null if no username was found.
      Parameters:
      request - HTTP servlet request
      Returns:
      name of the authenticated user, null if no username was found
    • setAuthenticatedUser

      public static void setAuthenticatedUser(javax.servlet.http.HttpServletRequest request, String username)
      Sets the name of the authenticated application as an attribute of the HttpSession.
      Parameters:
      request - HTTP servlet request
      username - name of the authenticated user