1.1 JWT Authentication Setup

For User Authentication

This plugin is necessary for user registration and login authentication. After installing and activating the plugin, you will need to configure a few settings. You can either follow the provided guide or follow the steps outlined below:

You need to edit your .htaccess file by adding two lines of code. To locate the file, go to your Cpanel, navigate to File Manager, then to public_html > your_site directory. Once there, click to edit the .htaccess file, and add the following two lines just below the RewriteEngine On line. Finally, click on “Save Changes” at the top.

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

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.

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 and copy the NONCE SALT key and paste it here. After this, your lines will look like in the picture below: