WordPress REST API Authentication

Description

WordPress REST API Authentication secures rest API access for unauthorized users or from public access using API Key Authentication, JWT Token Authentication, Basic Authentication, OAuth 2.0 Authentication or Third Party OAuth 2.0 provider’s Token authentication Methods. Also, It allows you to login and register to WordPress REST APIs using any authentication method from the other applications like mobile, desktop application etc.

Usecases

  • Block the public access to your WordPress REST APIs like /pages, /posts
  • Authorize the API access for all users with authentication methods provided in the plugin
  • Integrate with Third party plugin APIs like Woocommerce and secure/ access their APIs
  • Authenticate WordPress APIs with the token / jwt token from other IDPs
  • Login and register into Mobile or other client applications using REST APIs

The plugin provides an interface for applications to interact with your WordPress REST APIs by sending and receiving data as JSON (JavaScript Object Notation) objects. Also, It provides user friendly user interface of the plugin to configure the methods and implement it.

There are multiple ways to secure a REST APIs e.g. basic auth, OAuth, JWT token etc. but one thing is sure that RESTful APIs should be stateless – so request authentication/authorization should not depend on cookies or sessions. Instead, each API request should come with some sort authentication credentials which must be validated on the server for each and every request.

REST API Authentication Methods

Basic Authentication

  • If you want to protect your WP REST APIs(eg. post, pages and other REST APIs) with users login credentials or client-id:client-secret, then you can opt for the basic authentication method. It is recommended that you should use this method on HTTPS or secure socket layer.
  • Username & Password Authentication – This method authenticate the REST APIs by using username and passwords in the authorization header with the form of base64 encoded.
  • Client-ID & Client-Secret Authentication – This method authenticate the REST APIs by using client credenrials in the authorization header with the form of base64 encoded. Client credenrials are provided by the plugin itself.

API Key Authentication (Authentication with Readonly Generated Key )

  • If you want to protect your WP REST APIs(eg. post, pages and other REST APIs) from unauthenticated users but you don’t want to share users login credentials or client id, secret to authenticate the REST API, then you can use API Key authentication, which will generate a random authentication key for you. Using this key, you can authenticate any REST API on your site.

JWT Authentication / JSON Web Tokens Authentication

  • If you are looking to protect your REST APIs using the JWT token and if you do not have any third party provider/identity provider that issues the JWT token, then you should go for JWT Authentication method. In this case, our WordPress REST API Authentication itself issues the JWT token and works as an API Authenticator to protect your REST APIs.

OAuth 2.0 Authentication

  • If you are looking for protecting your REST APIs using the access-token and at the same time you do not have any third party provider/identity provider, then you should go for OAuth 2.0 Authentication method. In this scenario, our WordPress REST API Authentication works as both OAuth Server and API Authenticator to protect your REST APIs.
  • Client Credentials Grant – This method uses the OAuth 2.0 protocol with Client Credentials grant to authenticate the REST APIs, the plugin will provide a time base token based on the client credenrials authentication and you can use it to register a user into WordPress by passing the token in the authorization header of user create API.
  • Password Grant – This method uses the OAuth 2.0 protocol with Password grant to authenticate the REST APIs, the plugin will provide a time base token based on the user credenrials authentication and you can use it to login into WordPress by passing the token into authorization header of every API request.

API Authentication for Third Party OAuth 2.0 Provider( using Introspection Endpoint / User Info Endpoint )

  • If you are looking for protecting/restricting access to your WP REST APIs using your OAuth Provider/Identity provider, then you should go for Third Party Provider Authentication method. It would be helpful to authenticate the WordPress REST APIs with different platforms token like JWT token of Google, AWS Cognito, Auth0, miniOrange, firebase, amazon, Apple etc and access token of facebook, Okta etc.

FEATURES

  • Supports Basic Authentication, API Key Authentication, OAuth 2.0 Authentication, JWT Token Authentication, Third Party OAuth 2.0 Provider Token Authentication methods
  • Global or Universal API Key & User specific API Keys for authentications
  • HMAC encryption & User specific Client credentials with the Basic authentication
  • Token endpoint to retrive user specific JWT Token
  • Signature validation using HSA & RSA Signing
  • Custom Token Expiry
  • Provides the admin privilege’s client ID and client secret
  • Provides the Time base Access token or JWT token
  • WordPress Login using Access token or JWT token
  • Authenticate WordPress REST APIs with token (access token / jwt token) provided by your OAuth Provider ( Third Party Provider )
  • User’s WordPress Role & Capability based access to WordPress posts, pages etc
  • WooCommerce API Authentication
  • Custom & Third Party plugin’s API Authentication.
  • Allow or Deny public access to your APIs as per requirement
  • Postman Samples for each Authentication method to test the APIs access with the Postman application

INTEGRATION

WooCommerce API

  • This plugin supports WordPress REST API Integration with the WooCommerce REST APIs. You can authenticate the WooCommerce store APIs with your mobile or desktop application & extend the features and functionality of the your eCommerce store.

BuddyPress API ( BP REST API )

  • This plugin supports BuddyPress API integration with WordPress REST APIs. You can access BP REST API endpoints and also authenticate those from different Authentication methods liek JWT token, API Keys etc.

Gravity Form API

  • The plugins supports interaction with Gravity Forms from an external client applications. WP REST API also allows WordPress users to create, read, update and delete forms, entries, and results over HTTP based on their roles.

Learndash API

  • The plugins allows accessing LearnDash API from mobile app or any external application. It provdes you the secure access to Learndash user profiles, courses, groups & many more APIs.

Privacy

This plugin does not store any user data.

Screenshots

  • List of API Authentication Methods
  • List of Protected WP REST APIs
  • Advanced Settings
  • Custom API Integration

Installation

This section describes how to install the WordPress REST API Authentication and get it working.

From your WordPress dashboard

  1. Visit Plugins > Add New
  2. Search for REST API Authentication. Find and Install api authentication plugin by miniOrange
  3. Activate the plugin

From WordPress.org

  1. Download WordPress REST API Authentication.
  2. Unzip and upload the wp-rest-api-authentication directory to your /wp-content/plugins/ directory.
  3. Activate WordPress REST API Authentication from your Plugins page.

FAQ

What is the use of API Authentication

The REST API authentication prevents the unauthorized access to your WordPress API’s. It reduces potential attack factors.

How to enable API access in WooCommerce?

You can enable API access in WooCommerce using our WP REST API Authentication plugin. Please reach out to us at info@xecurify.com.

How does REST API Authentication plugin work?

You just have to select your Authentication Method.
Based on the method you have selected you will get the authorization code/token after sending the token request.
Access your REST API with code/token you received in previous step.

How to access draft posts?

You can access draft posts using Basic Auth, OAuth 2.0(using Username:Password) methods. Pages/posts are need to access with the status. Default status used in request is ‘Publish’ and any user can access Published post.
To access the pages/posts stored in draft, you need to append the ?status=draft to the page/post request.
For Example:
You need to use below URL format while sending request to access different type of posts
1. Access draft posts only
https://localhost:8080/wp-json/wp/v2/posts?status=draft
2. Access all type of posts
https://localhost:8080/wp-json/wp/v2/posts?status=any
You just have to change the status(draft, pending, any, publish) as per your requirement. You do not have to pass status parameter to access Published posts.

Reviews

ফেব্ৰুৱাৰী 3, 2021
I had deactivated the plugin as I was facing issues with wordpress API. But immediately, I got an email from developers of the plugin and they took me on a zoom call and resolved my issue in just few minutes. I was not expecting such an immediate and excellent response for a free support call. Thanks for your immediate help and resolving my issues with your plugin. My best wishes to you.
জানুৱাৰী 14, 2021
We use WordPress as a membership site and identity provider for access to a Virtual Reality experience. WordPress REST API Authentication plug-in makes it possible for us to authenticate member users and give access to other apps. Most users in our membership don't remember their WordPress username, so we requested a modification from MiniOrange to add EMAIL ADDRESS to identify the user (instead of only WordPress UserName). MiniOrange support were quick to respond and offer a modification at reasonable cost. Allowing users to authenticate with their EMAIL ADDRESS or WordPress UserName is a much better experience. We purchased the one year of warranty support which was also reasonable. Everyone is happy. Thank you MiniOrange!
জানুৱাৰী 3, 2021
I was using this plugin since it was released and there was no such thing as this. Now, you are charging a hefty 149$ to 349$ as a one-time payment? This is serious looting on a bright day. All you want is to earn money? You are killing this plugin, man. This is now what I will call a failed plugin. 100 auth are free? I don't care about your 100 free auth. Rather than, I will hire some good dev and ask him to create the clone of this plugin that will not charge me this hefty amount or give free usage. Old days were good.
ডিচেম্বৰ 15, 2020
There is no other plug-in on the market that did this with the level of ratings and tech-support. I had to contact the team several times and they were highly responsive and helpful. Highly recommended.
Read all 27 reviews

Contributors & Developers

“WordPress REST API Authentication” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.4.2

  • UI updates

1.4.1

  • UI updates
  • Minor fixes

1.4.0

  • WordPress 5.6 compatibility

1.3.10

  • Allow all REST APIs to authenticate
  • Added postman samples
  • Minor Bugfix

1.3.9

  • Minor Bugfix

1.3.8

  • Added compatibility for WP 5.5

1.3.7

  • Bundle plan release
  • Minor Bugfix

1.3.6

  • Added compatibility for WP 5.4

1.3.5

  • Minor Bugfix

1.3.4

  • Minor Bugfix

1.3.2

  • Minor Bugfix

1.3.1

  • Minor Fixes

1.3.0

  • Added UI Changes
  • Updated plugin licensing
  • Added New features
  • Added compatibility for WP 5.3 & PHP7.4
  • Minor UI & feature fixes

1.2.1

  • Added fixes for undefined getallheaders()

1.2.0

  • Added UI changes for Signing Algorithms and Role Based Access
  • Added Signature Validation
  • Minor fixes

1.1.2

  • Added JWT Authentication
  • Fixed role based access to REST APIs
  • Fixed common class conflicts

1.1.1

  • Fixes to Create, Posts, Update Publish Posts

1.1.0

  • Updated UI and features
  • Added compatibility for WordPress version 5.2.2
  • Added support for accessing draft posts as per User’s WordPress Role Capability
  • Allowed Logged In Users to access posts through /wp-admin Dashboard

1.0.2

  • Added Bug fixes

1.0.0

  • Updated UI and features
  • Added compatibility for WordPress version 5.2.2