PHPackages                             joshcanhelp/wp-rest-api-auth0 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. joshcanhelp/wp-rest-api-auth0

ActiveWordpress-muplugin[API Development](/categories/api)

joshcanhelp/wp-rest-api-auth0
=============================

Protect a WP REST API with OAuth2 using Auth0

v4.0.0(2y ago)6312[2 issues](https://github.com/joshcanhelp/wp-rest-api-auth0/issues)[2 PRs](https://github.com/joshcanhelp/wp-rest-api-auth0/pulls)MITPHPPHP ^7 || ^8

Since Dec 31Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/joshcanhelp/wp-rest-api-auth0)[ Packagist](https://packagist.org/packages/joshcanhelp/wp-rest-api-auth0)[ Docs](https://www.joshcanhelp.com/protect-wordpress-rest-api-with-oauth2-auth0/)[ RSS](/packages/joshcanhelp-wp-rest-api-auth0/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)DependenciesVersions (8)Used By (0)

Protect your WordPress REST API with Auth0
==========================================

[](#protect-your-wordpress-rest-api-with-auth0)

[![License](https://camo.githubusercontent.com/5719f1ffb226e08338a47a246be25e6bc2a4048867c01a2e084937349a5270f5/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736863616e68656c702f77702d726573742d6170692d61757468302f6c6963656e7365)](https://packagist.org/packages/joshcanhelp/wp-rest-api-auth0)[![Total Downloads](https://camo.githubusercontent.com/5382fe31c3b9b45d9267df51923fc80504bf6bfe8c81ea8f592138e006d617bd/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736863616e68656c702f77702d726573742d6170692d61757468302f646f776e6c6f616473)](https://packagist.org/packages/joshcanhelp/wp-rest-api-auth0)

This repo contains a working MU plugin that will receive and validate access tokens obtained from Auth0. For information on how this works and the values used within please see the post here:

**[Protect your WordPress REST API with OAuth2 using Auth0](https://www.joshcanhelp.com/protect-wordpress-rest-api-with-oauth2-auth0/)**

Installation
------------

[](#installation)

First, install the [Login by Auth0 plugin](https://wordpress.org/plugins/auth0/), then add your Auth0 credentials to `wp-config.php`, a file in `wp-content/mu-plugins`, or another location that will get loaded before this plugin.

```
// Auth0 credentials
define( 'AUTH0_API_AUDIENCE', 'API identifier for the WP REST API' );
define( 'AUTH0_API_SIGNING_SECRET', 'API signing secret from Auth0' );
define( 'AUTH0_API_DEBUG', 'Set to `true` to add debugging log entries' );
```

### Install with Composer

[](#install-with-composer)

Install this package:

```
composer require joshcanhelp/wp-rest-api-auth0
```

Require the Composer autoloader at some point when `add_action` is available, like in `wp-content/mu-plugins`.

### Install manually

[](#install-manually)

To install this manually without Composer, just download the [latest release ZIP](https://github.com/joshcanhelp/wp-rest-api-auth0/releases) and upload through the admin interface. Please note that this plugin will not update automatically; updates will need to be made by deleting and re-adding (make sure your site is in maintenance mode) or directly via an FTP client (not recommended).

### Testing with Docker

[](#testing-with-docker)

You can get this running to test it out locally with Docker using [this Gist](https://gist.github.com/joshcanhelp/0e35b657ca03142e3d79595c28bb3ed7).

Troubleshooting
---------------

[](#troubleshooting)

Try setting `AUTH0_API_DEBUG` to `true` and watching your WP error log for information on failures.

If API requests aren't working, Apache might not be passing authorization headers to PHP. Try adding this line (or similar methods) to `.htaccess`:

```
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

```

Also, make sure your WP API endpoint doesn't follow this pattern, where `/index.php/` is required before `/wp-json/`:

```
Example:
https:///index.php/wp-json/

```

See [this solution](http://dejanjanosevic.info/remove-index-php-permalink-in-wordpress/) to help resolve this index.php issue.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance53

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~203 days

Recently: every ~254 days

Total

6

Last Release

992d ago

Major Versions

v1.1.0 → v2.0.02021-02-16

v2.0.1 → v3.0.02022-11-14

v3.0.0 → v4.0.02023-10-16

PHP version history (2 changes)v1.0.0PHP ^7.1

v3.0.0PHP ^7 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/55b762a3611ccc95ac18a466a27c9e4264f726cab0a93b382d516d69c5f41ed1?d=identicon)[joshcanhelp](/maintainers/joshcanhelp)

---

Top Contributors

[![joshcanhelp](https://avatars.githubusercontent.com/u/855223?v=4)](https://github.com/joshcanhelp "joshcanhelp (39 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (6 commits)")[![ludovicsclain](https://avatars.githubusercontent.com/u/13393845?v=4)](https://github.com/ludovicsclain "ludovicsclain (2 commits)")[![alyxb](https://avatars.githubusercontent.com/u/671123?v=4)](https://github.com/alyxb "alyxb (1 commits)")

---

Tags

apiwordpressoauth2auth0REST APIaccess token

### Embed Badge

![Health badge](/badges/joshcanhelp-wp-rest-api-auth0/health.svg)

```
[![Health](https://phpackages.com/badges/joshcanhelp-wp-rest-api-auth0/health.svg)](https://phpackages.com/packages/joshcanhelp-wp-rest-api-auth0)
```

###  Alternatives

[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

70556.6k](/packages/wp-graphql-wp-graphql-woocommerce)[weble/zohoclient

Zoho API Client for oAuth auth and common tasks - PHP SDK

11215.9k5](/packages/weble-zohoclient)[shahghasiadil/laravel-api-versioning

Elegant attribute-based API versioning solution for Laravel applications with built-in deprecation management and version inheritance

2915.6k](/packages/shahghasiadil-laravel-api-versioning)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
