1. Home
  2. ...
  3. Security Interceptors
  4. CSRF Validation

CSRF Validation

Validation of the token generated by the CSRF Generator to prevent CSRF attacks.

This interceptor is used along with the CSRF Generator interceptor to prevent cross-site request forgery (CSRF). It validates the token generated by the CSRF Generator interceptor. Read more about CSRF and how to create a token here.

NOTE

If the OAuth interceptor is already inserted in the flow, there's no need to add the CSRF Generator/CSRF Validation interceptors to prevent attacks, since the OAuth feature imposes the inclusion of a token in the call.

TIP: These interceptors are recommended when the API is open (without OAuth or client ID authentication).

The interceptor must be inserted in the request flow of an operation that has CSRF Generator in its response flow:

Configuring the interceptor

To configure it, insert the same token Location and Name that are informed in the CSRF Generator settings.

By doing so, any request coming from an unexpected origin or containing an expired token will be barred by the system, avoiding a CSRF attack from happening.

NOTE

If your API returns the status code 401 Unauthorized when using this interceptor, the token may be invalid. See more details on this page of our FAQs.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more