A AuthMS API Wiki API Reference iam.tianv.com →

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

NameInTypeRequiredDefaultExampleConstraintsDescription
token formData string Yes 待检查的令牌(access_token 或 refresh_token)

Responses

StatusDescriptionSchema
200自省结果(active=true 时包含完整令牌元数据;active=false 时仅返回 active 字段)dto.TokenIntrospectionResponse
400invalid_request:缺少 token 参数。参考:RFC 7662 §2.1。dto.OAuthErrorResponse
500server_error:自省服务内部错误dto.OAuthErrorResponse

Referenced Schemas

dto.OAuthErrorResponse

OAuth标准错误响应

FieldTypeRequiredExampleConstraintsDescription
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

令牌自检结果

FieldTypeRequiredExampleConstraintsDescription
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 用户名