WW JWT Auth
WordPress plugin for JWT authentication for the REST / XML-RPC API
★ 0stars
65composer installs
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sjinks/wp-jwt-auth/archive/refs/heads/master.zipAlso on Packagist as wildwolf/wp-jwt-auth:
composer require wildwolf/wp-jwt-authFrom the readme
wp-jwt-auth
WordPress plugin for JWT authentication for the REST / XML-RPC API
Installation
Composer Way
Then go to Admin Dashboard, Plugins, find and activate the "WW JWT Auth" plugin
Manual Way
Grab the plugin zip file from Releases, then go to Admin Dashboard, Plugins, Add New, Upload Plugin. Select the zip file, the click Install Now. Finally, activate the plugin.
REST API Authentication
The plugin uses bearer authentication (also known as token authentication) to authenticate the user.
To authenticate the request, you need to have a JWT. Then you need to set the Authorization header:
API
REST API
Generate Token
POST /wp-json/wildwolf/jwtauth/v1/generate
or
POST /wp-json/jwt-auth/v1/token
Request body:
username: login;
password: password.
Successful Response:
Status code: 200
JSON Object:
token: JWT token;
useremail: email address of the user;
displayname: display name of the user.
Failure:
Status code: 403 for authentication failures, 500 for misconfiguration (JWT secret is not set)
Validate Token
GET /wp-json/wildwolf/jwtauth/v1/verify
or
GET /wp-json/jwt-auth/v1/token/validate
Required headers:
Authorization: Bearer JWT-goes-here
Successfule res