At page 776, is described:
Quote:
Only requests ignored and excluded from the chain (for
example, in configure(WebSecurity)) are unprotected. However, this is not always desirable
for all secured URLs. In the Customer Support application, for example, you should not include
CSRF protection on the RESTful and SOAP web services because they don’t use web forms
|
This should be done from this piece of code:
Quote:
.requireCsrfProtectionMatcher((r) -> {
String m = r.getMethod();
return !r.getServletPath().startsWith("/services/") &&
("POST".equals(m) || "PUT".equals(m) ||
"DELETE".equals(m) || "PATCH".equals(m));
});
|
But, when i try to make a POST request (Using Advanced Rest Client) it first make a POST requesto to /services/Rest and after it, it make a request via GET to /login , and this REST call reply with the form (that is wrong, because WebServices dont use forms).
If i make a requesto with OPTIONS type, the request is ok, because first make OPTIONS to services/Rest and later an OPTIONS to /login.
why if i use a POST, this make POST and after GET /login ?
Is something wrong in this code? I've tried to import the entire project in eclipse (as i have downloaded from the site), and i've noticed this Behaviour