# JWT Authentication for WP REST API setup

**URL:** https://community.kinsta.com/t/jwt-authentication-for-wp-rest-api-setup/774
**Category:** Application Support
**Created:** [June 16, 2021, 4:39pm UTC](https://community.kinsta.com/t/jwt-authentication-for-wp-rest-api-setup/774 "2021-06-16T16:39:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gregory\_Saumier-Finc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/gregory_saumier-finc/32/548_2.png) [@Gregory\_Saumier-Finc](https://community.kinsta.com/u/Gregory_Saumier-Finc)
#### Post date: [June 16, 2021, 4:39pm UTC](https://community.kinsta.com/t/jwt-authentication-for-wp-rest-api-setup/774/1 "2021-06-16T16:39:11Z")

</div>

I am trying to use [JWT Authentication for WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/#description). I am able to generate bearer tokens and validate them using POST /jwt-auth/v1/token and also validate the token using POST /jwt-auth/v1/token/validate.

When I try to use WP REST API from another application, I get the following error:

```auto
{
    "code": "jwt_auth_bad_config",
    "message": "JWT is not configurated properly, please contact the admin",
    "data": {
        "status": 403
    }
}

```

I have followed the setup instruction, but there is one part that asks to modify .htaccess.

```auto
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

```

But since DevKinsta uses nginx instead of apache there is no .htaccess I can find.

I found this issue [Directive for NGINX · Issue #194 · Tmeister/wp-api-jwt-auth · GitHub](https://github.com/Tmeister/wp-api-jwt-auth/issues/194)

```auto
fastcgi_pass_header Authorization;

```

How can I add this to the nginx config in DevKinsta?

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [June 16, 2021, 4:46pm UTC](https://community.kinsta.com/t/jwt-authentication-for-wp-rest-api-setup/774/2 "2021-06-16T16:46:58Z")

</div>

Hi @Gregory_Saumier-Finc ! We can indeed edit the nginx configuration, however keep in mind that restarting nginx will revert the configuration our default. [Here’s a guide on that](https://community.kinsta.com/t/nginx-configuration-for-bedrock/201/2).

[We do have this feature request here](https://community.kinsta.com/t/ability-to-upload-custom-nginx-rules/378). Another thing to note is that nginx configurations are not transferrable to or from Kinsta’s live sites.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [October 29, 2021, 2:25pm UTC](https://community.kinsta.com/t/jwt-authentication-for-wp-rest-api-setup/774/3 "2021-10-29T14:25:03Z")

</div>

We haven’t heard back from you on this topic in a while. However, if you do need further assistance you can simply start a new forum thread. Thank you again for using DevKinsta. Let us know if you need further assistance! 👋

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [October 29, 2021, 2:25pm UTC](https://community.kinsta.com/t/jwt-authentication-for-wp-rest-api-setup/774/4 "2021-10-29T14:25:05Z")

</div>


