POST /oauth/pushed-authorization

OAuth 2.0 推送授权请求端点(PAR)。客户端将授权参数提前推送到授权服务器,获取 request_uri 后在授权请求中使用。返回扁平 JSON(无 code/message 信封)。参考:RFC 9126 (Pushed Authorization Requests)。

OAuth None application/json

请求体

Schema: service-oauth/internal/handler/dto.PushedAuthorizationRequest

字段类型必填示例约束描述
client_id string 是 app-123 客户端ID
redirect_uri string 是 https://app.example.com/callback 回调URI
response_type string 是 code 响应类型
scope string 是 openid profile 范围
authorization_details array of

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

否 RAR授权详情
client_secret string 否 secret_abc123 客户端密钥
code_challenge string 否 E9Melhoa2Ow... 代码挑战
code_challenge_method string 否 S256 挑战方法
nonce string 否 nonce-123 随机数
resources array of

string

否 资源
state string 否 state-123 状态

响应

状态描述Schema
201PAR 响应(含 request_uri 和 expires_in)service-oauth/internal/handler/dto.PushedAuthorizationResponse
400invalid_request:请求参数缺失或无效。参考:RFC 9126。service-oauth/internal/handler/dto.OAuthErrorResponse
401invalid_client:客户端认证失败。参考:RFC 9126。service-oauth/internal/handler/dto.OAuthErrorResponse
500server_error:存储授权请求失败。参考:RFC 9126。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.PushedAuthorizationResponse

PAR响应

字段类型必填示例约束描述
expires_in integer 否 90 过期秒数
request_uri string 否 urn:example:request_uri:xxx 请求URI