Name: wp-jwt-auth
Owner: Auth0
Description: [DEPRECATED] This plugin targets to add JWT authentication to Wordpress API's provided by plugins.
Created: 2015-04-28 21:27:43.0
Updated: 2018-01-22 15:01:02.0
Pushed: 2017-11-28 14:15:54.0
Homepage: http://auth0.com
Size: 208
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This library was built as an example for a session in a PHP conference, and is no longer supported.
Authenticate your APIs with JWT easily.
This plugin will check the headers of the requests and if there is an Authorization
header will try to log in a user that matches. So it is as easy to check for the current user to authenticate users in your own API.
Also, it provides support for the following plugins:
And any other that extends Wp Rest Api
like http://tweichart.github.io/JSON-API-for-BuddyPress/ for BuddyPress.
The user repository is the responsible of retriving the user based on the JWT. By default, it looks in the user database to match the User Property and the JWT Attribute.
If you need to override the way the user matching is made (ie: you need to look to another table in the database) you can create your own User Repostory and match the user as you need.
To accomplish this, you need to add a filter:
add_filter( 'wp_jwt_auth_get_user', array( __CLASS__, 'get_user' ),10);
To see an example, check the UsersRepo.
When the plugin is using a User Repository the User Property and JWT Property settings are ignored.