joshcanhelp / wp-rest-api-auth0
Protect a WP REST API with OAuth2 using Auth0
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Type:wordpress-muplugin
Requires
- php: ^7.1
- auth0/auth0-php: ^7.5
This package is auto-updated.
Last update: 2021-01-12 16:28:15 UTC
README
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 withing please see the post here:
Protect your WordPress REST API with OAuth2 using Auth0
Installation
Add your Auth0 credentials to wp-config.php
or another location that will get loaded before plugins.
// Auth0 credentials define( 'AUTH0_DOMAIN', 'Your Auth0 domain' ); define( 'AUTH0_API_AUDIENCE', 'API identifier for the WP REST API' ); define( 'AUTH0_API_SIGNING_SECRET', 'API signing secret from Auth0' );
Install with Composer
Install this package:
composer require joshcanhelp/wp-rest-api-auth0
Require the autoloader at some point when add_action
is available, like in wp-content/mu-plugins
.
Install manually
To install this manually without Compsoer, just download the latest release ZIP 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
You can get this running to test using Docker using this Gist.