Class XsrfTokenUtils

java.lang.Object
com.atlassian.bamboo.security.xsrf.XsrfTokenUtils

public class XsrfTokenUtils extends Object
  • Method Details

    • getTokenFromRequestParameters

      public static String getTokenFromRequestParameters(javax.servlet.http.HttpServletRequest request)
      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

      public static String getXsrfTokenSource(javax.servlet.http.HttpServletRequest request)
    • 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.