Implementing CSRF tokens in Strapi

[details=“System Information”]
“strapi”: “3.5.2”,
“strapi-admin”: “3.5.2”,
“strapi-connector-bookshelf”: “3.5.2”,
“strapi-plugin-content-manager”: “3.5.2”,
“strapi-plugin-content-type-builder”: “3.5.2”,
“strapi-plugin-email”: “3.5.2”,
“strapi-plugin-graphql”: “3.5.2”,
“strapi-plugin-upload”: “3.5.2”,
“strapi-plugin-users-permissions”: “3.5.2”,
“strapi-utils”: “3.5.2”

  • **Operating Systemubuntu 20.04:
  • **Databasepostgres:
  • **Node Versionv14.0.0:
  • **NPM Version6.14.4:
  • **Yarn Version1.22.10:

Hey guys!

So I was looking through option for authentication with strapi. I came to the conclusing that HttpOnly JWT would be a good option for my project. To get sufficient security I want to implement this with CSRF tokens to protect my users. Does anyone have any idea how to do this. I somebody could guide me in the right direction, that would be great! Thanks in advance!


1 Like

Hi, I am also stuck at this phase and need an idea on how to generate CSRF token through Strapi. Do anybody has any idea on this ?

Thanks in advance!