Skip to content

Change in the JavaScriptServlet doPost() logic in 4.1.1 from 3.1.0 #52

Answered by forgedhallpass
crkharan asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @crkharan,

In 4.x the code base went through a major refactoring, both on Java and JavaScript side, hence if you're upgrading, you'll have to use the latest version of csrfguard.js.

Currently, the general execution flow in short (non-JSP), is the following:

  • script tag in HTML references the JavaScriptServlet. In most cases this needs to be the first resource to be referenced.
  • GET request against JavaScriptServlet returns the JS code with an embedded masterToken.
  • (Only) if the token-per-page functionality is enabled a (second) POST request against the servlet is made with the masterToken.
    • if the masterToken is correct, and token-precreate is enabled, the response will contain the l…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@zhengjiudan
Comment options

@forgedhallpass
Comment options

Comment options

You must be logged in to vote
2 replies
@kallem
Comment options

@forgedhallpass
Comment options

Answer selected by forgedhallpass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants