Simple JWT Auth – JWT Authentication for WordPress REST API secures and protects your WordPress REST API using JSON Web Tokens. It lets external applications authenticate WordPress users, obtain an access token and a refresh token, and call any REST endpoint with a standard Bearer header. JSON Web T
PricingFree downloadThe WordPress.org download is free. Pro versions, add-ons or external services may cost extra.
CompatibilityRequires WordPress 7.0 and PHP 8.2.
SourceWordPress plugins · Oct 25, 2026
01 / Source details
Aboutthistool.
Simple JWT Auth – JWT Authentication for WordPress REST API secures and protects your WordPress REST API using JSON Web Tokens. It lets external applications authenticate WordPress users, obtain an access token and a refresh token, and call any REST endpoint with a standard Bearer header.
JSON Web Token (JWT) is an open standard ( RFC 7519 ) that defines a compact, self-contained way to transmit information securely between two parties. This plugin uses JWT to provide a modern, stateless authentication layer for headless WordPress builds.
Modern access-token and refresh-token architecture
Refresh-token rotation — every refresh issues a new access token and a new refresh token, so a leaked refresh token is quickly invalidated.
Reuse detection — re-presenting a rotated refresh token outside a short grace window revokes the entire token family and fires the simplejwt_auth_token_reuse_detected action.
Revocation — revoke a single refresh token, its whole rotation family, or all of a user’s sessions. Refresh tokens are also revoked automatically on logout and password reset.
Validation — a dedicated endpoint verifies an access token on demand, and a /me endpoint returns the authenticated user’s profile.
Secure by design
Signing keys ( secret_key , private_key , public_key ) are encrypted at rest with AES-256-GCM using a key-encryption-key (KEK) defined in wp-config.php .
Refresh tokens are opaque and stored only as SHA-256 hashes — the raw token is never written to the database.
Rate limiting (configurable) is applied to the token, refresh, and revoke endpoints to deter brute force.
Optional CORS support and optional XML-RPC disabling.
Extensible via filter and action hooks for payload, expiry, issuer, CORS headers, and the token response.
Built for developers — authenticate WordPress from React, Next.js, Vue, mobile apps, and any other external client. Configuration can live in the plugin settings or be overridden with wp-config.php constants.
Support & questions: WordPress support forum
Bug reports: GitHub issues tracker
Source code: GitHub repository
Enable PHP HTTP Authorization Header
HTTP Authorization is the mechanism clients use to send credentials to a server — a special Authorization header in the HTTP request. Many shared hosts have it disabled by default.
Shared hosts
Add the following to your .htaccess file:
RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
Simple JWT Auth uses a Key-Encryption-Key (KEK) to encrypt and decrypt the JWT signing keys ( secret_key , private_key , and public_key ) at rest. Define it in wp-config.php with the SIMPLE_JWT_AUTH_ENCRYPT_KEY constant. The KEK must be exactly 32 characters long and must never be revealed.
Rotating the KEK invalidates the stored signing keys and requires re-entering them in the plugin settings (a simplejwt_kek_mismatch error is returned until then).
Signing keys via wp-config.php constants
Instead of storing signing keys in the database, define them directly in wp-config.php file. Constants take precedence over the plugin settings, and their values are used as-is (plaintext, not encrypted).
define( 'SIMPLE_JWT_AUTH_ALGORITHM', 'HS256' ); // HS256, HS384, HS512, RS256, RS384, RS512, ES256 or ES384. define( 'SIMPLE_JWT_AUTH_SECRET_KEY', 'your-secret-key' ); // Required for HS* algorithms (min 32 chars). define( 'SIMPLE_JWT_AUTH_PRIVATE_KEY', '-----BEGIN PRIVATE KEY-----...' ); // Required for RS*/ES* signing. define( 'SIMPLE_JWT_AUTH_PUBLIC_KEY', '-----BEGIN PUBLIC KEY-----...' ); // Required for RS*/ES* verification.
SIMPLE_JWT_AUTH_ALGORITHM — overrides algorithm , the JWT signing algorithm.
SIMPLE_JWT_AUTH_SECRET_KEY — overrides secret_key , used for symmetric (HS256/384/512) signing and verification.
SIMPLE_JWT_AUTH_PRIVATE_KEY — overrides private_key , used for asymmetric (RSA/EC) signing.
SIMPLE_JWT_AUTH_PUBLIC_KEY — overrides public_key , used for asymmetric (RSA/EC) verification.
When a constant is defined, the matching field on the Settings page is disabled and marked “Defined in wp-config.php”.
Enabling authentication
For a fresh install, authentication is disabled by default. Turn on Enable JWT in the plugin settings, choose an algorithm, and provide the required signing key(s) before issuing tokens.
REST Endpoints
The plugin registers the auth/v1 namespace with five endpoints:
POST /wp-json/auth/v1/token — Authenticate credentials; return an access token and a refresh token.
POST /wp-json/auth/v1/token/refresh — Rotate an access token (and refresh token) using a refresh token.
POST /wp-json/auth/v1/token/revoke — Revoke a refresh token and its rotation family.
POST /wp-json/auth/v1/token/validate — Validate an access token.
GET /wp-json/auth/v1/me — Return the authenticated user’s profile.
Generate a token
Submit a POST request with username and password :
Store the access token and refresh token in your application (a secure cookie, localStorage , or a wrapper such as localForage ). Then pass the access token as a Bearer header on every protected request:
Authorization: Bearer your-access-token
For example, creating a post with an access token:
curl --location 'https://example.com/wp-json/wp/v2/posts' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOi...' \ --data '{ "title": "Hello headless", "content": "Created through the REST API with JWT authentication.", "status": "publish" }'
Refresh a token
Access tokens are short-lived. When one expires, send the refresh token to /token/refresh (in the body or as a Bearer header) to rotate it and receive a new access token and refresh token:
Website LLMs.txt and LLMs-Full.txt Generator is an LLMs.txt generator and llms-full.txt generator for WordPress. It helps site owners generate, manage, preview, validate, and serve AI discovery files from published public content. Use it to create structured /llms.txt and optional /llms-full.txt end
EngageDock AI is a customizable floating contact widget for WordPress websites that want more leads and faster visitor communication. It helps small businesses turn website traffic into calls, texts, emails, and callback requests from one clean contact panel. Key Features: Click-to-Call – One tap ca
Altify AI is an auto ALT text and AI ALT text plugin for WordPress images. It helps generate descriptive image ALT text for accessibility and image SEO. Use bulk image ALT text tools for your Media Library, generate featured image ALT text automatically, and scale WooCommerce image ALT updates with
The Accepted Payment Methods plugin is a straightforward, lightweight solution that enhances your website by displaying visually appealing icons of the payment methods you accept. This plugin is ideal for a variety of websites, including e-commerce platforms, service-oriented websites, and informati