Closed dbcoder14 closed 2 years ago
Hi, After following the complete guideline provided at https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/; my authentication request still fails.
Following is the example of curl:
curl --location --request POST 'https://mydomain.dk/wp-json/jwt-auth/v1/token' \ --header 'Content-Type: application/json' \ --data-raw '{ "username": "email, "password": "2passwoed" }'
The username and password are valid, and I am successfully able to login in /wp-admin, but following is the error response I am receiving:
{ "code": "rest_login_required", "message": "REST API restricted to authenticated users.", "data": { "status": 401 } }
.htaccess
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 </IfModule>
Seems like jwt-auth/v1/token are not publically accessible, any hint?
The issue is resolved, rest api was block by other plugin.
Hi, After following the complete guideline provided at https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/; my authentication request still fails.
Following is the example of curl:
The username and password are valid, and I am successfully able to login in /wp-admin, but following is the error response I am receiving:
.htaccess
Seems like jwt-auth/v1/token are not publically accessible, any hint?