CSRF token mismatch While creating REST API

HI, I am creating a REST API for Android and iOS using CakePHP 3. I am using CakePHP 3 JWT plugin but whenever I create post request from postman I get this error.

    "message": "CSRF token mismatch.",
    "url": "/api/login",
    "code": 403,
    "file": "/var/www/html/hospital/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php",
    "line": 195

Can you please help to fix this. I am using latest version of CakePHP 3

1 Like

Are you sure you’re sending the CSRF token with the request? (either by sending it using the X-CSRF-Token header or by setting the csrfToken cookie, but I recommend using the header)