POST /oauth/refresh

OAuth 2.0 刷新令牌端点。使用 refresh_token 换取新的 access_token 和 refresh_token(轮换)。主接受 application/x-www-form-urlencoded(RFC 6749 §6,与 /oauth/token 同口径),兼容 JSON body(form 优先)。返回扁平 JSON(无 code/message 信封)。参考:RFC 6749 §6 (Refreshing an Access Token)。

OAuth None application/x-www-form-urlencoded application/json

请求参数

名称位置类型必填默认值示例约束描述
refresh_token formData string 是 刷新令牌
client_id formData string 否 客户端ID
client_secret formData string 否 客户端密钥

响应

状态描述Schema
200刷新后的令牌(含新的 access_token 和 refresh_token)service-oauth/internal/handler/dto.OAuthTokenResponse
400invalid_request:请求参数缺失或无效。参考:RFC 6749 §5.2。service-oauth/internal/handler/dto.OAuthErrorResponse
401invalid_grant:refresh_token 无效或过期。参考:RFC 6749 §5.2。service-oauth/internal/handler/dto.OAuthErrorResponse

引用的 Schema

service-oauth/internal/handler/dto.AuthorizationDetailDTO

字段类型必填示例约束描述
actions array of

string

否 ['["list_accounts"', '"read_balances"]'] 操作
constraints object 否 扩展约束
data_types array of

string

否 ['["account_details"', '"balances"]'] 数据类型
identifier string 否 account-12345 标识符
locations array of

string

否 ['["https://example.com/accounts"]'] 位置
type string 否 account_information 授权类型

service-oauth/internal/handler/dto.OAuthErrorResponse

OAuth标准错误响应

字段类型必填示例约束描述
error string 否 invalid_request 错误码
error_description string 否 Missing required parameter 错误描述
error_uri string 否 https://docs.example.com/errors 错误URI
i18n_key string 否 error.oauth_invalid_request I18nKey 本地化键(AUTH-46①/U416):协议字段 error/error_description 保持 RFC 6749 §5.2 原样, 本字段是**附加**信息(omitempty;未知错误码不填),供前端/AI 客户端按键确定性渲染文案, 无需解析英文原文。仅出现在 JSON 错误体,不写入 302 错误重定向的查询串。
state string 否 state-123 状态

service-oauth/internal/handler/dto.OAuthTokenResponse

OAuth令牌响应

字段类型必填示例约束描述
access_token string 否 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... 访问令牌
authorization_details array of

参见 service-oauth/internal/handler/dto.AuthorizationDetailDTO

否 RAR授权详情
dpop_access_token_bound boolean 否 访问令牌DPoP绑定确认(RFC 9449)
dpop_signing_alg string 否 DPoP签名算法(RFC 9449)
expires_in integer 否 3600 过期秒数
id_token string 否 eyJhbGci... OIDC ID令牌
refresh_token string 否 rt_abc123 刷新令牌
scope string 否 openid profile email 范围
token_type string 否 Bearer 令牌类型