SCIM API

  • Tier: 专业版,旗舰版
  • Offering: JihuLab.com
History
    • 引入于极狐GitLab 15.5。

使用此 API 管理群组中的 SCIM 身份。

先决条件:

此 API 与 内部群组 SCIM API实例 SCIM API 不同:

  • 此 API:

    • 不实现 RFC7644 协议。
    • 获取、检查、更新和删除群组中的 SCIM 身份。
  • 内部群组和实例 SCIM API:

    • 用于 SCIM 提供商集成的系统使用。
    • 实现 RFC7644 协议。
    • 获取群组或实例的 SCIM 配置用户列表。
    • 为群组或实例创建、删除和更新 SCIM 配置用户。

获取群组的 SCIM 身份#

History
    • 引入于极狐GitLab 15.5。
plaintext
GET /groups/:id/scim/identities

支持的属性:

属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径

如果成功,将返回 200 和以下响应属性:

属性类型描述
extern_uidstring用户的外部 UID
user_idinteger用户的 ID
activeboolean身份的状态

示例响应:

json
1[ 2 { 3 "extern_uid": "be20d8dcc028677c931e04f387", 4 "user_id": 48, 5 "active": true 6 } 7]

示例请求:

shell
curl --location --request GET "https://gitlab.example.com/api/v4/groups/33/scim/identities" \ --header "PRIVATE-TOKEN: <PRIVATE-TOKEN>"

获取单个 SCIM 身份#

History
    • 引入于极狐GitLab 16.1。
plaintext
GET /groups/:id/scim/:uid

支持的属性:

属性类型必需描述
idinteger群组的 ID 或 URL 编码路径
uidstring用户的外部 UID。

示例请求:

shell
curl --location --request GET "https://gitlab.example.com/api/v4/groups/33/scim/be20d8dcc028677c931e04f387" --header "PRIVATE-TOKEN: <PRIVATE TOKEN>"

示例响应:

json
{ "extern_uid": "be20d8dcc028677c931e04f387", "user_id": 48, "active": true }

更新 SCIM 身份的 extern_uid 字段#

History
    • 引入于极狐GitLab 15.5。

可以更新的字段有:

SCIM/IdP 字段极狐GitLab 字段
id/externalIdextern_uid
plaintext
PATCH /groups/:groups_id/scim/:uid

参数:

属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
uidstring用户的外部 UID。

示例请求:

shell
curl --location --request PATCH "https://gitlab.example.com/api/v4/groups/33/scim/be20d8dcc028677c931e04f387" \ --header "PRIVATE-TOKEN: <PRIVATE TOKEN>" \ --form "extern_uid=yrnZW46BrtBFqM7xDzE7dddd"

删除单个 SCIM 身份#

History
    • 引入于极狐GitLab 16.5。
plaintext
DELETE /groups/:id/scim/:uid

支持的属性:

属性类型必需描述
idinteger群组的 ID 或 URL 编码路径
uidstring用户的外部 UID。

示例请求:

shell
curl --location --request DELETE "https://gitlab.example.com/api/v4/groups/33/scim/yrnZW46BrtBFqM7xDzE7dddd" --header "PRIVATE-TOKEN: <your_access_token>"

示例响应:

json
{ "message" : "204 No Content" }