How to implement CSRF protection in Ajax calls using express.js (looking for complete example)?

Posted by Benjen on Stack Overflow See other posts from Stack Overflow or by Benjen
Published on 2012-06-26T02:37:30Z Indexed on 2012/06/26 3:16 UTC
Read the original article Hit count: 190

Filed under:
|
|
|
|

I am trying to implement CSRF protection in an app built using node.js using the express.js framework. The app makes abundant use of Ajax post calls to the server. I understand that the connect framework provides CSRF middleware, but I am not sure how to implement it in the scope of client-side Ajax post requests.

There are bits and pieces about this in other Questions posted here in stackoverflow, but I have yet to find a reasonably complete example of how to implement it from both the client and server sides.

Does anyone have a working example they care to share?

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about node.js