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 String
getAuthenticatedApplication
(javax.servlet.http.HttpServletRequest request) Returns the application name from theHttpSession
, ornull
if no application name was found.static Token
getAuthenticatedApplicationToken
(javax.servlet.http.HttpServletRequest request) Returns the application token from theHttpSession
, ornull
if there is nonestatic void
setAuthenticatedApplication
(javax.servlet.http.HttpServletRequest request, String applicationName) Sets the name of the authenticated application as an attribute of theHttpSession
.static void
setAuthenticatedApplicationToken
(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
, ornull
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 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
, ornull
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 theHttpSession
.- Parameters:
request
- HTTP servlet requesttoken
- application token
-