POST /oauth/introspect
OAuth 2.0 令牌自省端点。检查令牌的活跃状态,返回令牌的元数据(sub, client_id, scope, exp 等)。返回扁平 JSON(无 code/message 信封)。参考:RFC 7662 (Token Introspection)。
OAuth None application/x-www-form-urlencoded
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
token |
formData |
string |
Yes |
|
|
|
待检查的令牌(access_token 或 refresh_token) |
Referenced Schemas
dto.OAuthErrorResponse
OAuth标准错误响应
| Field | Type | Required | Example | Constraints | Description |
error |
string |
No |
invalid_request |
|
错误码 |
error_description |
string |
No |
Missing required parameter |
|
错误描述 |
error_uri |
string |
No |
https://docs.example.com/errors |
|
错误URI |
state |
string |
No |
state-123 |
|
状态 |
dto.TokenIntrospectionResponse
令牌自检结果
| Field | Type | Required | Example | Constraints | Description |
active |
boolean |
No |
True |
|
是否有效 |
aud |
string |
No |
auth-ms |
|
受众 |
client_id |
string |
No |
app-123 |
|
客户端ID |
exp |
integer |
No |
1713187200 |
|
过期时间 |
iat |
integer |
No |
1713183600 |
|
签发时间 |
scope |
string |
No |
openid profile |
|
范围 |
sub |
string |
No |
usr_abc123 |
|
用户ID |
token_type |
string |
No |
Bearer |
|
令牌类型 |
username |
string |
No |
user@example.com |
|
用户名 |