/oauth/bind/initiate
需 JWT 认证。服务端生成 PKCE 与签名 state,返回 provider 授权 URL;回调在 oauth-service 完成并跳回 return_to。
请求体
Schema: service-oauth/internal/handler/dto.BindInitiateRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
provider |
string |
是 | github |
||
return_to |
string |
是 | https://user.autional.cn/platform/security |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 授权 URL | dto.DataResponse-service-oauth/internal/handler/dto/BindInitiateResponse |
| 400 | 参数错误或 return_to 不在白名单 | service-core/base/dto.SimpleResponse |
| 401 | 未认证 | service-core/base/dto.SimpleResponse |
| 503 | 流程存储或 provider 未配置 | service-core/base/dto.SimpleResponse |
引用的 Schema
dto.DataResponse-service-oauth/internal/handler/dto/BindInitiateResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-oauth/internal/handler/dto.BindInitiateResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-oauth/internal/handler/dto.BindInitiateResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
auth_url |
string |
否 | https://github.com/login/oauth/authorize?... |
授权跳转URL | |
state |
string |
否 | random-state.hmac |
签名后的 state |