ajax - CSRF validation needed or not when using RESTful API? -


Text after "div class =" itemprop = "text">

The following is written on the page of FOSRestBundle:

"CSRF Verification

When creating a single application that should handle forms through both HTML forms as well as a rest api, a CSRF token runs in a problem with verification. In most cases it enables them to make HTML forms Is necessary, but it does make no sense to use for a REST API. For this reason, there is an extension of the form to disable CSRF verification for users with a specific role, of course, it is important that other API users get themselves certified and assign a special role. "

Is this explanation correct? Can you explain the reason that this is correct?

Thank you!

After

CSRF token validation is not actually used to implement actual web services because This violates the initial principles of REST ( REST stateless , no customer reference is being saved on the server side), instead, any referrer can see the header (for this Per-user status is not required) and maybe custom Some combinations of grade fields and GET parameters If your API is not public, you should use API-key based authentication or OAuth.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -