WordPress plugin intelligence profile

User Data Fields For JWT Authentication

Wordpress is a good content mangement system for building websites, but it will be better if you build like mobile apps,

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.0
Current version1.2.1
WordPress coverageTested up to WordPress 6.0
Minimum stackWP — · PHP —
Directory statusactive
Last directory update1 Aug 20224y ago
Active installations30Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 3 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records User Data Fields For JWT Authentication version 1.2.1 as active, updated 4y ago and tested up to WordPress 6.0.

Overview

About this plugin

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

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):

{

KeAUc7PiTne0_PThsSAWo1ruvl2Ocu-fbCn2jG7zkoE”,

com”,

“user_nicename”: “admin”,

“user_display_name”: “admin”

}

Example response (after install the plugin):

{

nyDOICdQcZKbWZo2kQRp_eLBkuxjnK_rpxs-HJREyCg”,

com”,

“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”,

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

org/plugins/jwt-authentication-for-wp-rest-api/]

Github

Can Add User Data Fields To Validate Token Endpoint?

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

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

REQUIREMENTS

JWT Authentication for WP REST API Plugin

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • json web authentication
  • wp api
  • wp json
  • jwt
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.0

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.0.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.0
Minimum requirementsWordPress not listed · PHP not listed
Update activity1 Aug 20224y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.