Class AuthenticatedApplicationUtil
java.lang.Object
com.atlassian.crowd.plugin.rest.service.util.RestAuthSessionHelperUtil
com.atlassian.crowd.plugin.rest.service.util.AuthenticatedApplicationUtil
Utility for setting and retrieving the application name and token from the
HttpServletRequest.- Since:
- v2.1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetAuthenticatedApplication(javax.servlet.http.HttpServletRequest request) Returns the application name from theHttpSession, ornullif no application name was found.static TokengetAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request) Returns the application token from theHttpSession, ornullif there is nonestatic voidsetAuthenticatedApplication(javax.servlet.http.HttpServletRequest request, String applicationName) Sets the name of the authenticated application as an attribute of theHttpSession.static voidsetAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request, Token token) Sets the application token of the authenticated application as an attribute of theHttpSession.Methods inherited from class com.atlassian.crowd.plugin.rest.service.util.RestAuthSessionHelperUtil
fetchStringFromRequestSession
-
Field Details
-
APPLICATION_NAME_ATTRIBUTE_KEY
- See Also:
-
APPLICATION_TOKEN_ATTRIBUTE_KEY
- See Also:
-
APPLICATION_SESSION_INACTIVE_INTERVAL_SECONDS
public static final int APPLICATION_SESSION_INACTIVE_INTERVAL_SECONDS- See Also:
-
-
Method Details
-
getAuthenticatedApplication
@Nullable public static String getAuthenticatedApplication(javax.servlet.http.HttpServletRequest request) Returns the application name from theHttpSession, ornullif no application name was found.- Parameters:
request- HTTP servlet request- Returns:
- name of the authenticated application,
nullif 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 theHttpSession.- Parameters:
request- HTTP servlet requestapplicationName- name of the authenticated application
-
getAuthenticatedApplicationToken
@Nullable public static Token getAuthenticatedApplicationToken(javax.servlet.http.HttpServletRequest request) Returns the application token from theHttpSession, ornullif there is none- Parameters:
request- HTTP servlet request- Returns:
- application token of the authenticated application, or
nullif 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 theHttpSession.- Parameters:
request- HTTP servlet requesttoken- application token
-