java.lang.Object
at.porscheinformatik.tapestry.csrfprotection.internal.CsrfTokenManager

public class CsrfTokenManager extends Object
This class contains the logic to create a secure token for cross-site script request forgery protection. It is created for a HTTP session and provides the same token throughout the whole session (per-session paradigm).
  • Constructor Details

  • Method Details

    • getSessionToken

      public CsrfToken getSessionToken()
      Returns the token stored in this instance.
      Returns:
      the stored token or a newly generated one
    • checkToken

      public void checkToken(org.apache.tapestry5.http.services.Request request, jakarta.servlet.http.HttpServletRequest httpServletRequest) throws CsrfException
      This method performs the check of the token. It extracts the current client token from the request and the current server-side token by accessing the CsrfTokenProvider instance assigned in this session.
      Parameters:
      request - .
      httpServletRequest - .
      Throws:
      CsrfException - when token not there or token does not match