Skip to main content

Validate a JWT and retrieve user details

GET 

/auth/validate

Verifies the JWT signature, checks expiry and revocation status, and returns the decoded token information together with the matching WordPress user profile and roles.

Audience When an expected audience is configured (plugin setting authorization.aud, or the audience of the JWT Rule the token matches), the JWT aud claim (a string or a list) must contain it. Otherwise this and every other JWT endpoint answers 401 with error_code 130. JWTs from /auth, /auth/refresh, register and OAuth carry the plugin audience when it is set.

JWT delivery The JWT can be passed via:

  • JWT query parameter
  • Authorization: Bearer <token> header (when enabled in plugin General Settings)
  • Cookie or session (when enabled in plugin General Settings)

A header, cookie, or session JWT is ignored on cross-site requests (Sec-Fetch-Site: cross-site, or an Origin / Referer naming another site) to prevent CSRF. Cross-origin browser apps must be listed in the CORS "Allow origin" setting; a * entry trusts the header JWT only, never the cookie or session JWT. Requests without these headers (mobile apps, servers) are not affected.

Requirements

  • Authentication and the validate endpoint must be enabled in the plugin settings.
  • The calling IP must pass the authentication IP allow-list.
  • If "Validate Token Requires Auth Code" is enabled, AUTH_KEY must be provided.

The response can be changed with the simple_jwt_login_response_validate_token filter.

Request​

Responses​

JWT is valid. Returns the decoded token and the associated WordPress user.