WP Sanctum
WP Sanctum is a WordPress plugin that brings Laravel Sanctum-like token authentication to WordPress.
★ 0stars
0forks
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/anwarpro/wp-sanctum/archive/refs/heads/main.zipFrom the readme
WP Sanctum - WordPress API Token Management
Description
WP Sanctum is a WordPress plugin that brings Laravel Sanctum-like token authentication to WordPress. It allows Single Page Applications (SPA), mobile apps, and third-party clients to authenticate securely using API tokens. This plugin provides token issuance, management, revocation, CSRF protection, and per-route ability enforcement.
Features
- Issue API tokens for WordPress users.
- SPA login/logout with cookies and CSRF token.
- Admin panel to view and revoke tokens.
- Per-route ability enforcement for REST API endpoints.
- Token expiration and revocation.
- REST API routes to fetch current user information.
- Compatible with WordPress REST API and custom frontends.
Installation
1. Upload the wp-sanctum folder to the /wp-content/plugins/ directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Configure settings in WP Sanctum admin menu if needed.
REST API Endpoints
| Endpoint | Method | Description |
| ---------------------------- | ------ | -------------------------------------------------- |
| /wp-sanctum/v1/token | POST | Issu