{"comment":{"created_at":"2011-10-17T09:10:33Z","body":"@stof: Thanks for the info, I'm gonna look for it to see if I can get it.\r\n\r\n@Ismith77: Yes, that would be a good idea. I was thinking about when loading the form in the client app, use the \"new\" method and get the token only, instead of the whole form as an option. I think it would be great for adding security to the REST methods.","updated_at":"2011-10-17T09:10:33Z","url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/comments/2426553","id":2426553,"user":{"gravatar_id":"2d0f96eaea954b9fe0b32a78cfce5db3","avatar_url":"https://secure.gravatar.com/avatar/2d0f96eaea954b9fe0b32a78cfce5db3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/ferrangimenezz","id":956357,"login":"ferrangimenezz"}},"action":"created","issue":{"number":139,"created_at":"2011-10-13T19:37:32Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi there again,\r\n\r\nI have a client-side app accessing a RESTful server, and for special needs of the application, the forms are coded in the client-side. So I have a problem with the CSRF, and I would like to know how you handle this guys.\r\n\r\nCSRF seems a good idea to add security to the app. As I can see, when a form is rendered a token hidden field is generated and then required for the validations. However, when the form is not created by the server app, you don't have this token. How can you get it?\r\n\r\nI've thought that before showing any form on the client-side, you could make a \"new\" restful call to the server and obtain that token, then build the form and submit it to the server with the previous token. But I can't find a way to generate that token. Can anybody help me?\r\n\r\nThanks a lot!","comments":3,"title":"CSRF token","updated_at":"2011-10-17T09:10:33Z","url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/139","id":1904009,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"2d0f96eaea954b9fe0b32a78cfce5db3","avatar_url":"https://secure.gravatar.com/avatar/2d0f96eaea954b9fe0b32a78cfce5db3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/ferrangimenezz","id":956357,"login":"ferrangimenezz"},"html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/issues/139","labels":[],"state":"open"},"legacy":{"issue_id":1904009,"comment_id":2426553}}