> For the complete documentation index, see [llms.txt](https://doc.newsfreak.mrb-lab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.newsfreak.mrb-lab.com/wordpress-setup/1.-install-plugins/1.1-jwt-authentication-setup.md).

# 1.1  JWT Authentication Setup

This plugin is required for the authentication purpose of user registration & login. After installing and activating the plugin, you have to configure some stuff. You can follow their guide or follow the steps below:

* You have to edit your .htaccess file and add two lines of code there. You can get the file in your Cpanel > File manager > public\_html > your\_site directory. Now click on edit the file and add the following two lines under the **RewriteEngine On** line and click on Save changes at the top.

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

{% hint style="info" %}
Note: There are many .htaccess files in the Cpanel file manager. You have to edit the right one, or else the login/registration process in the app won’t work. So, How do you know which is the right one?  You have to edit the .htaccess file from the folder where you have stored your WordPress site. Example:&#x20;

a) If you have installed the site directly in the public\_html directory without creating any additional folder, then you have to edit the .htaccess file from the public\_html directory.

b) if you have installed the site with an additional folder, like public\_html/recipehour.xyz/ then you have to edit the .htaccess file from the recipehour.xyz folder. That’s it.
{% endhint %}

* Now, again you have to edit your **wp-config.php** file and add two lines of code. You will get the file in the same directory **Cpanel > File manager > public\_html> your\_site> wp-config.php**. Now click on edit the file and add the following two lines under the define( 'WP\_DEBUG', false ); line.

```php
define('JWT_AUTH_SECRET_KEY', 'your-top-secret-key');
define('JWT_AUTH_CORS_ENABLE', true);
```

* After adding these two lines of code, you have to add a top-secret key in the first line of the following code. To get the code go to this [url](https://api.wordpress.org/secret-key/1.1/salt/) and copy the **NONCE SALT** key and paste it here. After this, your lines will look like in the picture below:

<figure><img src="https://lh3.googleusercontent.com/edwtp9A7Am4i7tqkCmULNX7z7k7JDOaFyuhffP5tihLo2aU4TdeKYWSoFFYCWmL8BCw9opTRw3v0q6KCaE3TAxKob_Sw4VaGYkIcDvDeZbvwlDzZpw47Dhovt_goQKT18akWt3jjQf2yVzPMDICJS2DKhk3wCly48XAwkVG4mQSoCH5mmB7XUQSexH9G" alt=""><figcaption></figcaption></figure>

Now save the file. That’s it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.newsfreak.mrb-lab.com/wordpress-setup/1.-install-plugins/1.1-jwt-authentication-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
