/admin/identity-providers
创建新的身份提供商(OAuth/OIDC/SAML/Social)
Request Body
Schema: dto.CreateIDPRequest
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
client_id |
string |
Yes | client_123 |
Client ID | |
client_secret |
string |
Yes | secret_456 |
Client Secret | |
name |
string |
Yes | My OIDC Provider |
显示名称 | |
type |
string |
Yes | custom |
类型 | |
attribute_mapping |
object |
No | extra keys: `string` | 字段映射 | |
auth_url |
string |
No | https://example.com/auth |
授权端点 | |
config |
object |
No | 额外配置 | ||
display_name |
string |
No | My OIDC Provider |
前端展示名称 | |
icon_url |
string |
No | https://example.com/icon.png |
图标URL | |
scopes |
array of string |
No | ['[openid', 'profile', 'email]'] |
权限范围 | |
sort_order |
integer |
No | 0 |
排序 | |
token_url |
string |
No | https://example.com/token |
Token端点 | |
user_info_url |
string |
No | https://example.com/userinfo |
用户信息端点 |
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | OK | dto.IDPDetailResponse |
| 400 | Bad Request | dto.SimpleResponseWrapper |
| 401 | Unauthorized | dto.SimpleResponseWrapper |
| 500 | Internal Server Error | dto.SimpleResponseWrapper |
Referenced Schemas
dto.IDPDetailResponse
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
data |
dto.IDPResponse |
No | |||
message |
string |
No | |||
timestamp |
string |
No |
dto.IDPResponse
身份提供商详细信息
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
attribute_mapping |
object |
No | extra keys: `string` | 字段映射 | |
auth_url |
string |
No | https://example.com/auth |
授权端点 | |
client_id |
string |
No | client_123 |
Client ID | |
config |
object |
No | 额外配置 | ||
created_at |
string |
No | 2026-01-01T00:00:00Z |
创建时间 | |
display_name |
string |
No | My OIDC Provider |
前端展示名称 | |
icon_url |
string |
No | https://example.com/icon.png |
图标URL | |
id |
string |
No | idp_abc123 |
提供商ID | |
is_popular |
boolean |
No | False |
常用提供商 | |
is_system |
boolean |
No | False |
系统内置 | |
name |
string |
No | My OIDC Provider |
显示名称 | |
scopes |
array of string |
No | ['[openid', 'profile', 'email]'] |
权限范围 | |
sort_order |
integer |
No | 0 |
排序 | |
status |
string |
No | active |
状态 | |
tenant_id |
string |
No | tnt_xyz789 |
租户ID | |
token_url |
string |
No | https://example.com/token |
Token端点 | |
type |
string |
No | custom |
类型 | |
type_display_name |
string |
No | 自定义 |
类型显示名称 | |
updated_at |
string |
No | 2026-04-10T14:20:00Z |
更新时间 | |
user_info_url |
string |
No | https://example.com/userinfo |
用户信息端点 |
dto.SimpleResponseWrapper
| Field | Type | Required | Example | Constraints | Description |
|---|---|---|---|---|---|
code |
integer |
No | |||
message |
string |
No |