com.atlassian.crowd.plugin.rest.service.util
Class AuthenticatedApplicationUtil

java.lang.Object
  extended by com.atlassian.crowd.plugin.rest.service.util.AuthenticatedApplicationUtil

public class AuthenticatedApplicationUtil
extends Object

Utility for setting and retrieving the application name and token from the HttpServletRequest.

Since:
v2.1

Field Summary
static String APPLICATION_NAME_ATTRIBUTE_KEY
           
static String APPLICATION_TOKEN_ATTRIBUTE_KEY
           
 
Method Summary
static String getAuthenticatedApplication(javax.servlet.http.HttpServletRequest request)
          Returns the application name from the HttpSession, or null if no application name was found.
static Token getAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request)
          Returns the application token from the HttpSession, or null if there is none
static void setAuthenticatedApplication(javax.servlet.http.HttpServletRequest request, String applicationName)
          Sets the name of the authenticated application as an attribute of the HttpSession.
static void setAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request, Token token)
          Sets the application token of the authenticated application as an attribute of the HttpSession.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_NAME_ATTRIBUTE_KEY

public static final String APPLICATION_NAME_ATTRIBUTE_KEY
See Also:
Constant Field Values

APPLICATION_TOKEN_ATTRIBUTE_KEY

public static final String APPLICATION_TOKEN_ATTRIBUTE_KEY
See Also:
Constant Field Values
Method Detail

getAuthenticatedApplication

@Nullable
public static String getAuthenticatedApplication(javax.servlet.http.HttpServletRequest request)
Returns the application name from the HttpSession, or null if no application name was found.

Parameters:
request - HTTP servlet request
Returns:
name of the authenticated application, null if no application name was found

setAuthenticatedApplication

public static void setAuthenticatedApplication(javax.servlet.http.HttpServletRequest request,
                                               String applicationName)
Sets the name of the authenticated application as an attribute of the HttpSession.

Parameters:
request - HTTP servlet request
applicationName - name of the authenticated application

getAuthenticatedApplicationToken

@Nullable
public static Token getAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request)
Returns the application token from the HttpSession, or null if there is none

Parameters:
request - HTTP servlet request
Returns:
application token of the authenticated application, or null if there is none

setAuthenticatedApplicationToken

public static void setAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request,
                                                    Token token)
Sets the application token of the authenticated application as an attribute of the HttpSession.

Parameters:
request - HTTP servlet request
token - application token


Copyright © 2014 Atlassian. All Rights Reserved.