{"id":32,"date":"2025-01-10T08:05:05","date_gmt":"2025-01-10T08:05:05","guid":{"rendered":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/?p=32"},"modified":"2025-01-10T08:17:56","modified_gmt":"2025-01-10T08:17:56","slug":"1-1-jwt-authentication-setup","status":"publish","type":"post","link":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/2025\/01\/10\/1-1-jwt-authentication-setup\/","title":{"rendered":"1.1 JWT Authentication Setup"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For User Authentication<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 <code><strong>RewriteEngine On<\/strong><\/code> line. Finally, click on &#8220;Save Changes&#8221; at the top.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteCond %{HTTP:Authorization} ^(.*)<br>RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]<\/pre>\n\n\n\n<p class=\"has-white-color has-medium-pink-background-color has-text-color has-background has-link-color wp-elements-4e16689398d66f2e7a6c59b2120dfb91 wp-block-paragraph\">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\u2019t 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:<br><br>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.<br><br>b) if you have installed the site with an additional folder, like public_html\/example.com\/ then you have to edit the .htaccess file from the recipehour.xyz folder. That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 <strong>Cpanel > File manager > public_html> your_site> wp-config.php<\/strong>. Now click on edit the file and add the following two lines under the define( &#8216;WP_DEBUG&#8217;, false ); line.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">define('JWT_AUTH_SECRET_KEY', 'your-top-secret-key');<br>define('JWT_AUTH_CORS_ENABLE', true);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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 <a href=\"https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/\" data-type=\"link\" data-id=\"https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">url<\/a> and copy the NONCE SALT key and paste it here. After this, your lines will look like in the picture below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"97\" src=\"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-content\/uploads\/sites\/71\/2025\/01\/image-1024x97.png\" alt=\"\" class=\"wp-image-51\" srcset=\"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-content\/uploads\/sites\/71\/2025\/01\/image-1024x97.png 1024w, https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-content\/uploads\/sites\/71\/2025\/01\/image-300x28.png 300w, https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-content\/uploads\/sites\/71\/2025\/01\/image-768x72.png 768w, https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-content\/uploads\/sites\/71\/2025\/01\/image-1536x145.png 1536w, https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-content\/uploads\/sites\/71\/2025\/01\/image.png 1570w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/htmldesigntemplates.com\/top-stories-docs\/2025\/01\/10\/1-1-jwt-authentication-setup\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">1.1 JWT Authentication Setup<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":18,"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":52,"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/posts\/32\/revisions\/52"}],"wp:attachment":[{"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/htmldesigntemplates.com\/top-stories-docs\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}