SSO 配置 列出¶
GET /api/v1/sso/saml_list
概述¶
读取当前工作空间的SSO提供商及关联成员数量。
调用前和使用步骤¶
此为旧地址兼容接口,当前源码仍实际注册;历史“2026-05-31下架”注释不表示当前已经禁止请求。新接入优先使用列出 SSO 配置。旧路径沿用相同控制器/请求字段/响应,不因saml前缀把OIDC排除。
返回本空间非删除提供商数组,按updateAt倒序,不分页。可按saml/oidc筛选;本公开route总是启用成员数统计,不能传showMemberCount覆盖。memberCount按当前空间活动关系中的非删除账号命名空间汇总,并不表示最近登录数、在线人数或当前映射全部允许的人数。
列表刻意不返回uploadData/config,不从列表读取clientSecret或完整XML;使用详情。updatorInfo为当前可用身份摘要,可能是账号、API Key或系统/AI身份,缺失{};其中email不能统一当邮箱。配置status与isOpenSAMLMapping是两个开关,禁用配置仍可被列表/get读取;读到不代表可以用其登录。
请求头¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| DF-API-KEY | string | Y | 工作空间的 OpenAPI 鉴权凭据。 例子: <DF-API-KEY>获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。 |
Query 请求参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| type | string | 可选,省略取全部非删除类型;空串不等于合法筛选枚举,建议省略。 允许 null: False 可选值: ['saml', 'oidc'] 例子: oidc获取或填写方式: 按提供商真实协议选择saml/oidc。 |
请求例子¶
curl --get 'https://openapi.guance.com/api/v1/sso/saml_list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-urlencode type=oidc
响应¶
HTTP 200,application/json。下方示例展示可直接读取的主要字段。
| 字段 | 类型 | 说明 |
|---|---|---|
| content | array<object> | 提供商数组,空[]。 |
| content[].id | integer 或 null | 当前记录编号,新建提交前构造结果可null。 |
| content[].uuid | string | sso_配置UUID。 |
| content[].type | string | saml/oidc。 |
| content[].workspaceUUID | string | 所属工作空间。 |
| content[].idpName | string | 提供商显示名称。 |
| content[].remark | string 或 null | 备注,旧/新建历史可能null。 |
| content[].role | string | 默认角色标识。 |
| content[].idpMd5 | string | 提供商身份/账号命名空间摘要,不是客户端密钥或可写ID。 |
| content[].tokenHoldTime | integer | 无操作会话保持秒数。 |
| content[].tokenMaxValidDuration | integer | 登录会话最大秒数。 |
| content[].isOpenSAMLMapping | integer 或 boolean | 角色映射开关1/0,不等同SSO配置status。 |
| content[].status | integer | 0启用、2禁用,非删除读取可能含其他历史状态。 |
| content[].creator | string | 创建身份。 |
| content[].updator | string | 更新身份。 |
| content[].createAt | integer | 创建Unix秒。 |
| content[].updateAt | integer | 更新Unix秒,未更新可-1。 |
| content[].deleteAt | integer | 删除Unix秒,未删-1。 |
| content[].memberCount | integer | 当前空间关联账号命名空间计数。 |
| content[].updatorInfo | object | 更新身份摘要,可为账号/Key/系统/AI;缺失{},字段随身份变化。 |
| content[].updatorInfo.uuid | string | 条件返回;更新身份UUID,系统身份可空串。 |
| content[].updatorInfo.name | string | 条件返回;显示名。 |
| content[].updatorInfo.email | string | 条件返回;人类身份可为邮箱;API Key身份为Key UUID,系统/AI身份为显示标签,不能作为有效邮箱使用。 |
| content[].updatorInfo.username | string | 条件返回;登录名。 |
| content[].updatorInfo.status | integer | 条件返回;身份状态,按账号/API Key/系统身份各自解释,不等同提供商status。 |
| content[].updatorInfo.wsAccountStatus | integer | 条件返回;该身份的空间关系/兼容状态,按身份类型解释,不保证是普通成员关系。 |
| content[].updatorInfo.iconUrl | string | 条件返回;头像。 |
| content[].updatorInfo.mobile | string | 条件返回;手机号。 |
| content[].updatorInfo.countryCode | string | 条件返回;手机号区号。 |
| content[].updatorInfo.acntWsNickname | string | 条件返回;空间昵称。 |
| content[].declaration | object 或 null | 非空业务对象附带的工作空间公共声明,未配置时可为null或空对象;空对象不添加。分页的准确位置以本页结构为准。 |
{
"code": 200,
"content": [
{
"id": 1,
"uuid": "sso_example",
"type": "oidc",
"workspaceUUID": "wksp_example",
"idpName": "ExampleIdP",
"remark": "企业登录",
"role": "general",
"idpMd5": "IDP-IDENTITY-HASH",
"tokenHoldTime": 604800,
"tokenMaxValidDuration": 2592000,
"isOpenSAMLMapping": 0,
"status": 0,
"creator": "wsak_example",
"updator": "wsak_example",
"createAt": 1785427200,
"updateAt": 1785427200,
"deleteAt": -1,
"memberCount": 2,
"updatorInfo": {},
"declaration": {}
}
],
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
错误响应¶
鉴权、限流和公共请求错误参见公共错误定义。
| HTTP 状态 | errorCode | 触发条件 | 消息或响应说明 | 处理方式 |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | 请求字段缺失,或字段值违反声明的校验条件 | 参数解析失败 | 核对参数位置、字段名、类型和取值。 |
| 500 | ft.InternalServerError | 数据库、XML工具初始化、身份摘要或成员数量统计格式化发生未处理异常 | 内部错误 | 保留traceId和筛选条件,核对数据库、XML工具及身份统计依赖;本接口只读,不把失败当作提供商不存在。 |