Please document using csrf_exempt for read-only POST APIs
See original GitHub issueI have a ReactJS application that is hosted on a separate domain from my Django app. But the library (Apollo) currently only makes requests with POST. Since I have no mutations in my Graphene implementations, it’s pretty safe for me to use csrf_exempt
for my GraphQL view.
Would you be able to add that to your documentation somewhere so that people know this is an option. Would you also be able to confirm that I’m correct in my deduction? 😃 If it’s still possible to write to GraphQL without mutations, I’ll need to look for a different solution.
Thanks!!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Should we check CSRF token for read only actions
If yes please share an example how action which only performs read only operations can be exploited using CSRF. web · csrf ·...
Read more >CSRF vulnerabilities: How to exploit and how to defend
Read-only GET requests. The first line of defense is to never allow GET request to perform CREATE / UPDATE / DELETE operations. SameSite...
Read more >CSRF token validation failed - SAP Community
Hello Expert,. While I am trying out the API Sales Order (A2X) by posting entity A_SalesOrder in API Hub,. Sandbox system returns the...
Read more >Cross Site Request Forgery protection - Django documentation
Requests via 'unsafe' methods, such as POST, PUT, and DELETE, can then be protected by the steps outlined in How to use Django's...
Read more >Configuring CSRF (Cross-Site Request Forgery) prevention in ...
In most cases, the browser checks your server's CORS policy by sending a preflight request before sending the actual operation. This is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Simply wrapping the view in a
csrf_exempt
is enough but yes, we should add this to the docs:This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.