How it works
Authorization Code flowโ
- The client sends the browser to
/oauth/authorize. - If the user isn't logged in, the normal WordPress login runs and returns to the authorize endpoint.
- The consent screen lists the requested scopes. The user chooses Allow or Deny.
- On approval a single-use authorization code (valid 10 minutes) is issued and the browser is redirected to the registered
redirect_uri. - The client exchanges the code at
/oauth/token. How it proves its identity depends on the client type. - The plugin returns an access token and an ID token (RS256 JWTs) and a refresh token.
Token lifetimesโ
| Token | Lifetime |
|---|---|
| Authorization code | 10 minutes, single use |
| Access token (JWT) | 1 hour |
| ID token (JWT) | 1 hour |
| Refresh token | 30 days, single-use rotation |
Each refresh token is revoked when used, and a new one is issued together with a fresh access token.
The lifetimes can be changed with filters, see Token lifetimes. A user's tokens are revoked when the user is deleted or changes or resets their password, see Revoking tokens.
Signing keysโ
On activation the plugin generates an RSA-2048 key pair. The private key stays in the options table; the public key is published at the JWKS endpoint, so clients verify tokens without any shared secret. The kid header in each JWT identifies the signing key.