OAuth Token Data
@Serializable
OAuth 令牌数据 包含 OAuth 访问令牌信息(OAuth 流程)
官方文档:vds-docs/VDS 账户/VDS 账户快速接入(OAuth).md
字段说明(对应官方 API 响应字段):
access_token: 访问令牌(OAuth 流程专用)
用于访问受保护的用户资源
通过 Authorization: Bearer
或 X-OAuth-Access-Token: 传递 expires_in: 有效期(秒),通常为 3600(1 小时)
token_type: 令牌类型,固定为 "Bearer"
scope: 授权的权限范围(可选)
多个权限用空格分隔
如 "user.profile user.email"
refresh_token: 刷新令牌(可选)
用于在 access_token 过期后获取新的访问令牌
仅在初次授权时返回,刷新令牌时可能轮换
仅在 grant_type=authorization_code 时返回
响应示例:
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "user.profile",
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2g..."
}Content copied to clipboard