We are getting error while posting data using POST servlet on "Stage environment".
User are not able to save their profile data due to CSRF token error (PFA error log). We have created POST servlet in AEM to save profile data like profile image, about section etc.
Note: The above error is occurring occasionally.
Thanks,
Views
Replies
Total Likes
are you using OOTB cq.jquery to post data or using from your own clientlib?
Thanks
Views
Replies
Total Likes
Yes, I am using OOTB cq.jquery which is included in clientlibs.
AEM version: AEM 6.1 SP1
Sometimes POST Servlet is not working due to 403 error in console, see below -
Views
Replies
Total Likes
Use AEM version of JQuery - it handles the token you need.
Views
Replies
Total Likes
If the request is coming from outside AEM(some third party application) then you can exclude the post servlet path in the CSRF filter configuration. Also, if you are using AEM 6.3 then you can configure Cross Origin configuration to allow requests(Post, put, delete) from trusted domains.
Views
Replies
Total Likes