New in 2.4: Test runs you can trust See what's new →

JWT authentication

JWT: log in for a signed JWT, call endpoints protected by [Authorize] and a role check, rotate refresh tokens, and fetch an expired token for negative tests.

Example request

Allow only JWTs with the admin role. Full reference and a Send button.

cURL
curl -X GET "https://api.testingapis.com/api/auth/jwt/admin" \
  -H "Authorization: Bearer {{adminJwt}}"
Run in Studio
Response · 200 OK
{"message": "Welcome, admin. You passed the role check.", "username": "admin"}