Title: jwt authentication
Last modified: April 20, 2019

---

# jwt authentication

 *  Resolved [dottodot](https://wordpress.org/support/users/dottodot/)
 * (@dottodot)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/)
 * Is there anyway to make this plugin work with jwt authentication? I’m using this
   plugin [https://en-gb.wordpress.org/plugins/jwt-authentication-for-wp-rest-api/](https://en-gb.wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
   but unfortunately the requests using jwt are also blocked

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/#post-11450163)
 * I’m not sure, haven’t tested it to be honest.
 *  Thread Starter [dottodot](https://wordpress.org/support/users/dottodot/)
 * (@dottodot)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/#post-11450202)
 * I realised it won’t as you’d need to whitelist the urls for that plugin i.e
 * /wp-json/jwt-auth/v1/token
    /wp-json/jwt-auth/v1/token/validate
 * when would mean you having to add a whitelist option. Anyway your plugin is nice
   and simple so I’ve just adapted it for my needs.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/#post-11450215)
 * Glad you got it sorted dottodot.
 *  [jacz](https://wordpress.org/support/users/jacz/)
 * (@jacz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/#post-11460273)
 * i have the that problem, how do i allow to request to /wp-json/jwt-auth/v1/token?.-.
 *  Thread Starter [dottodot](https://wordpress.org/support/users/dottodot/)
 * (@dottodot)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/#post-11461263)
 * I just copied the function used in this plugin and adapted it to accept request
   to those endpoint i.e
 *     ```
       function disable_wp_rest_api($access) {
   
       	if (!is_user_logged_in() && $_SERVER['REQUEST_URI'] !== "/wp-json/jwt-auth/v1/token" && $_SERVER['REQUEST_URI'] !== "/wp-json/jwt-auth/v1/token/validate") {
   
       		$message = apply_filters('disable_wp_rest_api_error', __('REST API restricted to authenticated users.', 'disable-wp-rest-api'));
   
       		return new WP_Error('rest_login_required', $message, array('status' => rest_authorization_required_code()));
   
       	}
   
       	return $access;
   
       }
       add_filter('rest_authentication_errors', 'disable_wp_rest_api');
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘jwt authentication’ is closed to new replies.

 * ![](https://ps.w.org/disable-wp-rest-api/assets/icon-256x256.png?rev=1926021)
 * [Disable WP REST API](https://wordpress.org/plugins/disable-wp-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disable-wp-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disable-wp-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-wp-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-wp-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-wp-rest-api/reviews/)

## Tags

 * [jwt](https://wordpress.org/support/topic-tag/jwt/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 5 replies
 * 3 participants
 * Last reply from: [dottodot](https://wordpress.org/support/users/dottodot/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/jwt-authentication-2/#post-11461263)
 * Status: resolved