JWT REST Auth Restrict
JWT REST Auth Restrict is a WordPress plugin that enhances REST API security by requiring authentication for all endpoints. You can whitelist specific routes (like JWT login or WooCommerce product endpoints) from the admin settings page.
by Samuvel Parthiban · github.com/samuvelparthiban/jwt-rest-auth-restrict
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/samuvelparthiban/jwt-rest-auth-restrict/archive/refs/heads/main.zipForce JWT authentication for all WordPress REST API requests with configurable allowed routes.
Description
JWT REST Auth Restrict is a WordPress plugin that enhances REST API security by requiring authentication for all endpoints. You can whitelist specific routes (like JWT login or WooCommerce product endpoints) from the admin settings page.
Features:
- Forces JWT or login authentication for all REST API requests
- Configurable allowed routes via WordPress admin
- Compatible with WooCommerce REST API
- Easy to extend and customize
Installation
- Upload the
jwt-rest-auth-restrictfolder to the/wp-content/plugins/directory. - Activate the plugin through the 'Plugins' menu in WordPress.
- Go to Settings → JWT REST Auth to configure allowed routes.
- Add comma-separated REST API routes that should remain public (like JWT login endpoints).
Frequently Asked Questions
Why do some REST API endpoints still work without a token?
By default, WordPress REST API endpoints (like pages or posts) are public. This plugin blocks access for unauthenticated users except for the routes you explicitly allow in settings.
Can I whitelist WooCommerce endpoints?
Yes! Just add them as comma-separated routes in the plugin settings, for example:
/wp-json/wc/v3/products, /wp-json/wc/v3/products/categories
Is this compatible with JWT Authentication plugin?
Yes, this plugin works alongside the JWT Authentication plugin to enforce authentication.
Changelog
1.0
- Initial release
- Added REST API authentication filter
- Added admin settings page for allowed routes
- Compatible with JWT Authentication plugin
Upgrade Notice
1.0 - Initial release. No upgrades yet.
License
This plugin is licensed under the GPLv2 or later.