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

JWT 认证

JWT:登录获取签名的 JWT,调用受 [Authorize] 和角色检查保护的端点,轮换刷新令牌,并获取一个已过期的令牌用于反向测试。

请求示例

Allow only JWTs with the admin role. 完整参考和 Send 按钮(英文).

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