/oauth/register/{client_id}
OAuth 2.0 动态客户端注册读取端点。使用 Registration Access Token 读取客户端当前元数据。参考:RFC 7591 §3 (Client Read Request)。
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|---|---|
client_id |
path |
string |
是 | 客户端ID | |||
Authorization |
header |
string |
是 | Bearer <registration_access_token> |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 客户端元数据 | service-oauth/internal/handler/dto.ClientRegistrationDetailResponse |
| 401 | invalid_token:缺少或无效的 Registration Access Token。参考:RFC 7591 §3.2。 | service-oauth/internal/handler/dto.OAuthErrorResponse |
引用的 Schema
service-oauth/internal/handler/dto.ClientRegistrationDetailResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-oauth/internal/handler/dto.ClientRegistrationResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-oauth/internal/handler/dto.ClientRegistrationResponse
OAuth 2.0 Dynamic Client Registration response (RFC 7591 §2.1)
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
application_type |
string |
否 | web |
应用类型 | |
client_id |
string |
否 | 01JNXXXXX... |
客户端ID | |
client_id_issued_at |
integer |
否 | 1715692800 |
客户端ID签发时间 | |
client_name |
string |
否 | My Application |
客户端名称 | |
client_secret |
string |
否 | sec_abc123... |
客户端密钥 | |
client_secret_expires_at |
integer |
否 | 0 |
客户端密钥过期时间(0=永不过期) | |
client_uri |
string |
否 | https://app.example.com |
客户端主页URL | |
contacts |
array of string |
否 | ['["admin@example.com"]'] |
联系人 | |
grant_types |
array of string |
否 | ['["authorization_code"', '"refresh_token"]'] |
授权类型 | |
logo_uri |
string |
否 | https://app.example.com/logo.png |
Logo URL | |
policy_uri |
string |
否 | https://app.example.com/privacy |
隐私政策URL | |
redirect_uris |
array of string |
否 | ['["https://app.example.com/callback"]'] |
回调URI列表 | |
registration_access_token |
string |
否 | reg_abc123... |
注册管理Token | |
registration_client_uri |
string |
否 | https://app.example.com/api/v1/oauth/register/app-123 |
注册管理URI | |
scope |
string |
否 | openid profile email |
权限范围 | |
token_endpoint_auth_method |
string |
否 | client_secret_basic |
认证方法 | |
tos_uri |
string |
否 | https://app.example.com/tos |
服务条款URL |
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 |
状态 |