django-spa-cookie-auth icon indicating copy to clipboard operation
django-spa-cookie-auth copied to clipboard

Token-based auth invulnerable to CSRF attacks

Open KristobalJunta opened this issue 3 years ago • 0 comments

Hello! First of all, thank you for the detailed article and all the effort put into providing both explanation and working examples. On the other hand, I think it is worth noting that for token-based auth (i.e. using HTTP headers to pass auth tokens) is not affected by CSRF attacks.

So, if opting for JWT (or any other header-based auth) as authentication method, adding CSRF protection does not provide any security benefits. Especially if API and SPA are cross-domain with a properly set up CORS.

KristobalJunta avatar Oct 26 '21 12:10 KristobalJunta