Plugin info

Total downloads: 9,792
Active installs: 60
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 3
Last updated: 9/26/2017 (3018 days ago)
Added to WordPress: 9/26/2017 (8 years old)
Minimum WordPress version: 4.4
Tested up to WordPress version: 4.8.27
Minimum PHP version: 5.2

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 3018 days ago

20/100

Is Disable REST API and Require JWT / OAuth Authentication abandoned?

Possibly abandoned (last update 3018 days ago).

Compatibility

Requires WordPress: 4.4
Tested up to: 4.8.27
Requires PHP: 5.2

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

StatCounter – Free Real Time Visitor Stats
Rating 4.0/5 (47 reviews)Active installs 70,000
BigBlueButton
Rating 3.9/5 (18 reviews)Active installs 4,000
Naver webmaster syndication v2
Rating 5.0/5 (2 reviews)Active installs 600
TopList.cz
Rating 5.0/5 (3 reviews)Active installs 500

Description

When you activate this plugin, all REST API endpoints will be disabled for non-authorized requests.

Best used with any of these plugins:

Blocks ALL REST API endpoints except for:

  • /jwt-auth/v1/token/validate
  • /jwt-auth/v1/token
  • /oauth/authorize
  • /oauth/token
  • /oauth/me

Allows all REST API endpoints if they come with a valid Bearer Token Authentication (authentication via GET URL variables are still blocked)

When used alone in your site, your REST API will essentially be disabled.

Note that this plugin itself doesn’t provide JWT or OAuth authentication, it only whitelists them.

Features

  • No settings page
  • You can whitelist other REST API endpoint via a filter hook (see FAQs below)
  • Blocks all REST API endpoints.. but
  • Allows requests with Bearer Token Authentication.. and
  • Allows JWT Authentication for WP REST API & WP OAuth Server authentication endpoints

Installation

  1. Head over to Plugins > Add New in the admin
  2. Search for “Disable REST API and Require Authentication”
  3. Install & activate the plugin
  4. Now your REST API endpoints are disabled for non-authenticated requests.

Frequently Asked Questions

Installation Instructions

  1. Head over to Plugins > Add New in the admin
  2. Search for “Disable REST API and Require Authentication”
  3. Install & activate the plugin
  4. Now your REST API endpoints are disabled for non-authenticated requests.

How is this different from Disable REST API?

This plugin is similar to Disable REST API, wherein it disables all REST API endpoints, but it still allows the authentication endpoints provided by:

And if a Bearer Token Authentication is provided, then the REST API becomes available.

How can I check if my REST API is disabled?

Open a new incognito browser tab or private browser tab and visit your wp-json URL:

http://mysite/wp-json/

You will see this message:

{"code":"rest_not_logged_in","message":"You are not currently logged in.","data":{"status":401}}

What is a Bearer Token Authenticated REST API request?

A Bearer Token Authenticated REST API request is a REST API call with this header:

Authorization: Bearer XXXXXXX

The XXXXXXX corresponds to the authentication token given by any of these 2 plugins:

How do I implement JWT / OAuth authentication?

That is outside the scope of this plugin, please refer to the docs of the respective plugins:

How do I whitelist other REST API endpoints? (via filter hook)

I’ve placed a filter called reqauth/allowed_endpoints where you can add your own REST API endpoints to the whitelist.

For example, I want to allow /my-endpoint for non-authorized REST API calls:

add_filter( 'reqauth/allowed_endpoints', 'allow_my_endpoints' );
function( $allowed_endpoints ) {
    $allowed_endpoints[] = '/my-endpoint';
    return $allowed_endpoints;
}

Review feed

No reviews available

Screenshots

  1. Blocked REST API requests

    Blocked REST API requests

  2. Authenticated REST API requests are allowed

    Authenticated REST API requests are allowed

Changelog

v1.0

  • Initial release