
WordPress is a good content mangement system for building websites, but it will be better if you build like mobile apps,
With the wordpress rest api you can create posts, edit posts, view posts, Users, Uploading Media etc…
but the problem with the wordpress rest api it does not provide any authentication methods for third party application like mobile apps
The Jwt Plugin on wordpress.org does provide that
and this plugin is just a addon for that plugin
So this plugin is useful if you don’t want to make another request to fetch user data like Id etc..
because you have to get the id of the user in ordet to get all data
It really simple plugin
it writed with 50 lines of code, the size of the plugin is 3Kb
Note: This Is Plugin For
JWT Authentication for WP REST API Plugin
so if the jwt authentication plugin is not installed
this plugin will not add the fields to it endpoints
and the fields will be added only if the token is getted successfully
Example request (before install the plugin):
{
“token”: “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjAuMTgyIiwiaWF0IjoxNjE0MDg3NDQ2LCJuYmYiOjE2MTQwODc0NDYsImV4cCI6MTYxNDY5MjI0NiwiZGF0YSI6eyJ1c2VyIjp7ImlkIjoiMSJ9fX0.KeAUc7PiTne0_PThsSAWo1ruvl2Ocu-fbCn2jG7zkoE”,
“user_email”: “[email protected]”,
“user_nicename”: “admin”,
“user_display_name”: “admin”
}
Example response (after install the plugin):
{
“token”: “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xOTIuMTY4LjAuMTgyIiwiaWF0IjoxNjE0MDg2NjQyLCJuYmYiOjE2MTQwODY2NDIsImV4cCI6MTYxNDY5MTQ0MiwiZGF0YSI6eyJ1c2VyIjp7ImlkIjoiMSJ9fX0.nyDOICdQcZKbWZo2kQRp_eLBkuxjnK_rpxs-HJREyCg”,
“user_email”: “[email protected]”,
“user_nicename”: “admin”,
“user_display_name”: “admin”,
“user_id”: 1,
“user_login”: “admin”,
“user_first_name”: “sfd”,
“user_last_name”: “”,
“user_roles”: [
“administrator”
],
“user_role”: “administrator”,
“user_registered”: “2021-02-17 09:21:29”,
“user_url”: “http://localhost”,
“user_status”: “0”,
“user_avatar_url”: “https://secure.gravatar.com/avatar/22feea4605ac5b7163eac439b5241034?s=96&d=mm&r=g”,
“user_activation_key”: “”
}
Of course you can add the code of this plugin to your Theme,
but this is not recommened because when you change the theme or update it
the changes will revert back, you can create child theme for that
but instead you can just install this simple plugin
Don’t forget to setup (JwtAuthenticatonForWordpress)[https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/]
This plugin can also add user data fields to validate token endpoint,
Unfortunately, the jwt extension does not support using the filter for validate_token function,
So You Will Need To Modify Some Codes Inside Jwt Plugin Codes
Go To \wp-content\plugins\jwt-authentication-for-wp-rest-api\public\class-jwt-auth-public.php
And At The End Of Function That Named validate_token
In Line 302
Edit This Code
From :
/** If the output is true return an answer to the request to show it */
return array(
‘code’ => ‘jwt_auth_valid_token’,
‘data’ => array(
‘status’ => 200,
),
);
To :
$value = array(
‘code’ => ‘jwt_auth_valid_token’,
‘data’ => array(
‘status’ => 200,
)
);
/** If the output is true return an answer to the request to show it */
return apply_filters(‘jwt_auth_validate_token’, $value, $token);
Now you have done,
the plugin should be able to add new values by adding a filter
Note :
If you updated the jwt plugin,
you should again edit the code because it will be removed
Starting from $0 per month.
Rating
Reviewers
3 reviews
Tags
Developed By
Ahmed Hnewa
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Create interactive maps with color coding and tooltips to visualize data clearly and embed engaging maps on your site.

Show Tumblr posts with a Tumblr feed that keeps content fresh, improves navigation, and helps visitors discover more posts.

Show WordPress posts with a WordPress feed that keeps content fresh, improves navigation, and helps visitors discover more of your site.
Display Bluesky posts with a Bluesky feed carousel that auto updates, shows posts in a clear layout, and keeps visitors engaged.
Create a clear restaurant menu list that helps visitors explore dishes easily, understand key details, and make confident ordering decisions that support conversions.
Show progress with animated progress circles that visualize goals, display achievements, and keep visitors engaged.
Use tilted image effects to rotate visuals, add creative style, and keep visitors engaged with dynamic images on your site.
Add a PDF viewer to your site to display documents, share product information, and give visitors easy access to helpful content in one place.
Show Facebook reviews to build trust, improve credibility, and help visitors make confident purchase decisions that support higher sales.
Add an interactive spinning wheel to offer prizes, capture leads, and drive user engagement through gamified rewards.
Create real estate listings with a listings widget that displays properties clearly, supports customization, and helps visitors explore homes more easily.
Create engaging stop motion displays with a stop motion player that turns image sequences into interactive animations to boost creativity and visitor engagement.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
