Class XsrfTokenUtils
java.lang.Object
com.atlassian.bamboo.security.xsrf.XsrfTokenUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable String
getOrCreateXsrfCookie
(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull javax.servlet.http.HttpServletResponse response) Returns an existing xsrf cookie if the request contains a xsrf cookie already.static String
getTokenFromRequestParameters
(javax.servlet.http.HttpServletRequest request) Returns the xsrf token value from the request parameters.static @Nullable String
getXsrfToken
(@NotNull javax.servlet.http.HttpServletRequest request) Returns value of the xsrf token for the given requeststatic String
getXsrfTokenSource
(javax.servlet.http.HttpServletRequest request)
-
Method Details
-
getTokenFromRequestParameters
Returns the xsrf token value from the request parameters.- Parameters:
request
- the request to obtain the xsrf token from.- Returns:
- the xsrf token value derived from the parameters of the given request.
-
getXsrfTokenSource
-
getOrCreateXsrfCookie
@Nullable public static @Nullable String getOrCreateXsrfCookie(@NotNull @NotNull javax.servlet.http.HttpServletRequest request, @NotNull @NotNull javax.servlet.http.HttpServletResponse response) Returns an existing xsrf cookie if the request contains a xsrf cookie already. If the request did not include a xsrf cookie, then a new one is created.- Parameters:
request
- the executing request.response
-- Returns:
- an existing xsrf token value or null if it has only just been created
-
getXsrfToken
@Nullable public static @Nullable String getXsrfToken(@NotNull @NotNull javax.servlet.http.HttpServletRequest request) Returns value of the xsrf token for the given request- Parameters:
request
- the executing request- Returns:
- the xsrf token for the given request.
-