SCIM の REST API エンドポイント
REST API を使って、SCIM でのユーザー作成とチーム メンバーシップを自動化します。
注:
- これらのエンドポイントは、SCIM を使用してGitHub Enterprise Cloudで Enterprise のユーザー アカウントをプロビジョニングできるようにします。 この操作は、Enterprise Managed Users でのみ使用できます。 Enterprise Managed Users を使用せずに、SCIM を使用して organization へのアクセスをプロビジョニングする場合は、「SCIM の REST API エンドポイント」を参照してください。
- GitHub では、IdP と GitHub 上の運用データから分離された環境でプロビジョニングをテストすることをお勧めします。
SCIM の概要
GitHub で Enterprise メンバーのユーザー アカウントを作成、管理、非アクティブ化するには、IdP が GitHub とのコミュニケーション用に SCIM を できる場合があります。 SCIM は、システム間のユーザー ID を管理するためのオープン仕様です。 IDP が異なると、SCIM プロビジョニングの構成に異なるエクスペリエンスが提供されます。既存の統合でパートナー IdP を使用しない場合は、次の API エンドポイントを使用して統合できます。 詳しくは、「REST API を使用した SCIM でユーザーとグループのプロビジョニング」を参照してください。
ベース URL
SCIM を使用して Enterprise のユーザーとグループを管理するには、次のベース URL を使用して、このカテゴリのエンドポイントと通信します。
https://api.github.com/scim/v2/enterprises/{enterprise}/
認証
API 要求の認証を行うには、IdP で SCIM を構成するユーザーは、scim:enterprise
スコープで personal access token (classic) を使う必要があります。これは、IdP が要求の Authorization
ヘッダーで指定する必要があります。 personal access tokens (classic) の詳細については、「個人用アクセス トークンを管理する」を参照してください。
GitHub では、エンタープライズのセットアップ ユーザーとして認証することをお勧めします。 他のユーザー アカウントは SCIM を使用して作成されるため、別のユーザーとして認証すると、Enterprise からロックアウトされるなど、意図しない結果になる可能性があります。 これらの API への書き込み要求は、公開された IdP アプリケーション、または SCIM エンドポイントへの直接 API アクセスを通じて可能です。 別のエンタープライズ所有者が API から情報を読み取る必要がある場合は、admin:enterprise
スコープで personal access token (classic) を使用して、現在の SCIM 実装で GET
要求を行います。 詳しくは、「REST API endpoints for SCIM」を参照してください。
SAML および SCIM データのマッピング
マネージド ユーザー アカウント が SAML SSO を使用して Enterprise にアクセスするために正常に認証されると、GitHub Enterprise Cloud はユーザーを SCIM プロビジョニング ID にリンクします。 ID を正常にリンクするには、SAML ID プロバイダーと SCIM 統合で一致する一意識別子を使用する必要があります。
GitHub では、ユーザーを SCIM によってプロビジョニングされた ID と正常に一致させるには、次のSAML クレームと SCIM 属性が必要です。 ID プロバイダーによって、ユーザーを一意に識別するために使用されるフィールドが異なる場合があります。
SAML 用の Microsoft Entra ID
SAML に Entra ID (旧称 Azure AD) を使用するには、次の SAML 要求と SCIM 属性が一致する必要があります。
SAML 要求 | 一致 SCIM 属性 |
---|---|
http://schemas.microsoft.com/identity/claims/objectidentifier | externalId |
SAML 用のその他の IdP
SAML に他の IdP を使用するには、次の SAML 要求と SCIM 属性が一致する必要があります。
SAML 要求 | 一致 SCIM 属性 |
---|---|
NameID | userName |
サポートされている SCIM ユーザー属性
このカテゴリの Users
エンドポイントでは、要求のパラメーター内で次の属性がサポートされています。
名前 | 種類 | 説明 |
---|---|---|
displayName | String | 人が判読できるユーザーの名前。 |
name.formatted | String | 表示用に書式設定された、すべてのミドル ネーム、役職、サフィックスを含む、ユーザーのフル ネーム。 |
name.givenName | String | ユーザーの名。 |
name.familyName | String | ユーザーの姓。 |
userName | String | SCIM プロバイダーが生成したユーザーのユーザー名。 使用する前に正規化を行います。 ユーザーごとに一意である必要があります。 |
emails | Array | ユーザーのメールの一覧。 |
roles | Array | ユーザーのロールの一覧。 |
externalId | String | この識別子は、SCIM プロバイダーが生成します。 ユーザーごとに一意である必要があります。 |
id | String | GitHub SCIM エンドポイントによって生成された識別子。 |
active | Boolean | ID がアクティブである (true ) か、中断する必要がある (false ) かを示します。 |
サポートされている SCIM グループ属性
このカテゴリの Groups
エンドポイントでは、要求のパラメーター内で次の属性がサポートされています。
名前 | 種類 | 説明 |
---|---|---|
displayName | String | 人が判読できるグループの名前。 |
members | String | SCIM プロバイダーでグループに割り当てられているメンバーの一覧 |
externalId | String | この識別子は、SCIM プロバイダーが生成します。 ユーザーごとに一意である必要があります。 |
List provisioned SCIM groups for an enterprise
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Lists provisioned SCIM groups in an enterprise.
You can improve query search time by using the excludedAttributes
query parameter with a value of members
to exclude members from the response.
"List provisioned SCIM groups for an enterprise" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"List provisioned SCIM groups for an enterprise" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 |
---|
filter string If specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are |
excludedAttributes string Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time. |
startIndex integer Used for pagination: the starting index of the first result to return when paginating through values. Default: |
count integer Used for pagination: the number of results to return per page. Default: |
"List provisioned SCIM groups for an enterprise" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Success, either groups were found or not found |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
429 | Too many requests |
500 | Internal server error |
"List provisioned SCIM groups for an enterprise" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups
Success, either groups were found or not found
Status: 200
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults": 1,
"Resources": [
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
"id": "24b28bbb-5fc4-4686-a153-a020debb1155",
"displayName": "Engineering",
"members": [
{
"value": "879db59-3bdf-4490-ad68-ab880a2694745",
"$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
"displayName": "User 1"
},
{
"value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
"$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
"displayName": "User 2"
}
],
"meta": {
"resourceType": "Group",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
}
}
],
"startIndex": 1,
"itemsPerPage": 20
}
Provision a SCIM enterprise group
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Creates a SCIM group for an enterprise.
When members are part of the group provisioning payload, they're designated as external group members. Providers are responsible for maintaining a mapping between the externalId
and id
for each user.
"Provision a SCIM enterprise group" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Provision a SCIM enterprise group" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 | |||
---|---|---|---|
schemas array of strings 必須The URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are: | |||
externalId string 必須A unique identifier for the resource as defined by the provisioning client. | |||
displayName string 必須A human-readable name for a security group. | |||
members array of objects 必須The group members. | |||
Properties of |
名前, Type, 説明 |
---|
value string 必須The local unique identifier for the member |
displayName string 必須The display name associated with the member |
"Provision a SCIM enterprise group" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
201 | Group has been created |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
409 | Duplicate record detected |
429 | Too many requests |
500 | Internal server error |
"Provision a SCIM enterprise group" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X POST \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups \
-d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"externalId":"8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159","displayName":"Engineering"}'
Group has been created
Status: 201
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
"externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
"displayName": "Engineering",
"members": [
{
"value": "879db59-3bdf-4490-ad68-ab880a2694745",
"$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
"displayName": "User 1"
},
{
"value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
"$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
"displayName": "User 2"
}
],
"meta": {
"resourceType": "Group",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
}
}
Get SCIM provisioning information for an enterprise group
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Gets information about a SCIM group.
"Get SCIM provisioning information for an enterprise group" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Get SCIM provisioning information for an enterprise group" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_group_id string 必須A unique identifier of the SCIM group. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 |
---|
excludedAttributes string Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time. |
"Get SCIM provisioning information for an enterprise group" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Success, a group was found |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
429 | Too many requests |
500 | Internal server error |
"Get SCIM provisioning information for an enterprise group" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID
Success, a group was found
Status: 200
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
"externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
"displayName": "Engineering",
"members": [
{
"value": "879db59-3bdf-4490-ad68-ab880a2694745",
"$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
"displayName": "User 1"
},
{
"value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
"$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
"displayName": "User 2"
}
],
"meta": {
"resourceType": "Group",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
}
}
Set SCIM information for a provisioned enterprise group
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Replaces an existing provisioned group’s information.
You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the Update an attribute for a SCIM enterprise group endpoint instead.
"Set SCIM information for a provisioned enterprise group" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Set SCIM information for a provisioned enterprise group" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_group_id string 必須A unique identifier of the SCIM group. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 | |||
---|---|---|---|
schemas array of strings 必須The URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are: | |||
externalId string 必須A unique identifier for the resource as defined by the provisioning client. | |||
displayName string 必須A human-readable name for a security group. | |||
members array of objects 必須The group members. | |||
Properties of |
名前, Type, 説明 |
---|
value string 必須The local unique identifier for the member |
displayName string 必須The display name associated with the member |
"Set SCIM information for a provisioned enterprise group" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Group was updated |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
409 | Duplicate record detected |
429 | Too many requests |
500 | Internal server error |
"Set SCIM information for a provisioned enterprise group" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X PUT \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
-d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"externalId":"8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159","displayName":"Engineering"}'
Group was updated
Status: 200
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
"externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
"displayName": "Engineering",
"members": [
{
"value": "879db59-3bdf-4490-ad68-ab880a2694745",
"$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
"displayName": "User 1"
},
{
"value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
"$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
"displayName": "User 2"
}
],
"meta": {
"resourceType": "Group",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
}
}
Update an attribute for a SCIM enterprise group
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Update a provisioned group’s individual attributes.
To modify a group's values, you'll need to use a specific Operations JSON format which must include at least one of the following operations: add, remove, or replace. For examples and more information on this SCIM format, consult the SCIM specification. The update function can also be used to add group memberships.
You can submit group memberships individually or in batches for improved efficiency.
Note
Memberships are referenced via a local user id. Ensure users are created before referencing them here.
"Update an attribute for a SCIM enterprise group" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Update an attribute for a SCIM enterprise group" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_group_id string 必須A unique identifier of the SCIM group. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 | ||||
---|---|---|---|---|
Operations array of objects 必須patch operations list | ||||
Properties of |
名前, Type, 説明 |
---|
op string 必須次のいずれかにできます: |
path string |
value string Corresponding 'value' of that field specified by 'path' |
schemas
array of strings 必須undefinedSupported values are: urn:ietf:params:scim:api:messages:2.0:PatchOp
"Update an attribute for a SCIM enterprise group" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Success, group was updated |
204 | No Content |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
409 | Duplicate record detected |
429 | Too many requests |
500 | Internal server error |
"Update an attribute for a SCIM enterprise group" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X PATCH \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
-d '{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"replace","path":"displayName","value":"Employees"}]}'
Success, group was updated
Status: 200
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
"externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
"displayName": "Engineering",
"members": [
{
"value": "879db59-3bdf-4490-ad68-ab880a2694745",
"$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
"displayName": "User 1"
},
{
"value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
"$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
"displayName": "User 2"
}
],
"meta": {
"resourceType": "Group",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
}
}
Delete a SCIM group from an enterprise
Note
SCIM provisioning using the REST API is in public preview and subject to change.
Deletes a SCIM group from an enterprise.
"Delete a SCIM group from an enterprise" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Delete a SCIM group from an enterprise" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_group_id string 必須A unique identifier of the SCIM group. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
"Delete a SCIM group from an enterprise" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
204 | Group was deleted, no content |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
429 | Too many requests |
500 | Internal server error |
"Delete a SCIM group from an enterprise" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID
Group was deleted, no content
Status: 204
List SCIM provisioned identities for an enterprise
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Lists provisioned SCIM enterprise members.
When you remove a user with a SCIM-provisioned external identity from an enterprise using a patch
with active
flag to false
, the user's metadata remains intact. This means they can potentially re-join the enterprise later. Although, while suspended, the user can't sign in. If you want to ensure the user can't re-join in the future, use the delete request. Only users who weren't permanently deleted will appear in the result list.
"List SCIM provisioned identities for an enterprise" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"List SCIM provisioned identities for an enterprise" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 |
---|
filter string If specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are |
startIndex integer Used for pagination: the starting index of the first result to return when paginating through values. Default: |
count integer Used for pagination: the number of results to return per page. Default: |
"List SCIM provisioned identities for an enterprise" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Success, either users were found or not found |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
429 | Too many requests |
500 | Internal server error |
"List SCIM provisioned identities for an enterprise" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users
Success, either users were found or not found
Status: 200
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults": 1,
"Resources": [
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"externalId": "E012345",
"id": "7fce0092-d52e-4f76-b727-3955bd72c939",
"active": true,
"userName": "E012345",
"name": {
"formatted": "Ms. Mona Lisa Octocat",
"familyName": "Octocat",
"givenName": "Mona",
"middleName": "Lisa"
},
"displayName": "Mona Lisa",
"emails": [
{
"value": "mlisa@example.com",
"type": "work",
"primary": true
}
],
"roles": [
{
"value": "User",
"primary": false
}
]
}
],
"startIndex": 1,
"itemsPerPage": 20
}
Provision a SCIM enterprise user
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Creates an external identity for a new SCIM enterprise user.
SCIM is responsible for user provisioning, not authentication. The actual user authentication is handled by SAML. However, with SCIM enabled, users must first be provisioned via SCIM before they can sign in through SAML.
"Provision a SCIM enterprise user" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Provision a SCIM enterprise user" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 | |||||
---|---|---|---|---|---|
schemas array of strings 必須The URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are: | |||||
externalId string 必須A unique identifier for the resource as defined by the provisioning client. | |||||
active boolean 必須Whether the user active in the IdP. | |||||
userName string 必須The username for the user. | |||||
name object | |||||
Properties of |
名前, Type, 説明 |
---|
formatted string The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. |
familyName string 必須The family name of the user. |
givenName string 必須The given name of the user. |
middleName string The middle name(s) of the user. |
displayName
string 必須A human-readable name for the user.
emails
array of objects 必須The emails for the user.
Properties of emails
名前, Type, 説明 |
---|
value string 必須The email address. |
type string 必須The type of email address. |
primary boolean 必須Whether this email address is the primary address. |
roles
array of objects The roles assigned to the user.
Properties of roles
名前, Type, 説明 |
---|
display string |
type string |
value string 必須The role value representing a user role in GitHub. 次のいずれかにできます: |
primary boolean Is the role a primary role for the user. |
"Provision a SCIM enterprise user" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
201 | User has been created |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
409 | Duplicate record detected |
429 | Too many requests |
500 | Internal server error |
"Provision a SCIM enterprise user" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X POST \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users \
-d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],"externalId":"E012345","active":true,"userName":"E012345","name":{"formatted":"Ms. Mona Lisa Octocat","familyName":"Octocat","givenName":"Mona","middleName":"Lisa"},"displayName":"Mona Lisa","emails":[{"value":"mlisa@example.com","type":"work","primary":true}],"roles":[{"value":"User","primary":false}]}'
User has been created
Status: 201
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "7fce0092-d52e-4f76-b727-3955bd72c939",
"externalId": "E012345",
"active": true,
"userName": "E012345",
"name": {
"formatted": "Ms. Mona Lisa Octocat",
"familyName": "Octocat",
"givenName": "Mona",
"middleName": "Lisa"
},
"displayName": "Mona Lisa",
"emails": [
{
"value": "mlisa@example.com",
"type": "work",
"primary": true
}
],
"roles": [
{
"value": "User",
"primary": false
}
],
"meta": {
"resourceType": "User",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
}
}
Get SCIM provisioning information for an enterprise user
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Gets information about a SCIM user.
"Get SCIM provisioning information for an enterprise user" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Get SCIM provisioning information for an enterprise user" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_user_id string 必須The unique identifier of the SCIM user. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
"Get SCIM provisioning information for an enterprise user" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Success, a user was found |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
429 | Too many requests |
500 | Internal server error |
"Get SCIM provisioning information for an enterprise user" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID
Success, a user was found
Status: 200
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "7fce0092-d52e-4f76-b727-3955bd72c939",
"externalId": "E012345",
"active": true,
"userName": "E012345",
"name": {
"formatted": "Ms. Mona Lisa Octocat",
"familyName": "Octocat",
"givenName": "Mona",
"middleName": "Lisa"
},
"displayName": "Mona Lisa",
"emails": [
{
"value": "mlisa@example.com",
"type": "work",
"primary": true
}
],
"roles": [
{
"value": "User",
"primary": false
}
],
"meta": {
"resourceType": "User",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
}
}
Set SCIM information for a provisioned enterprise user
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Replaces an existing provisioned user's information.
You must supply complete user information, just as you would when provisioning them initially. Any previously existing data not provided will be deleted. To update only a specific attribute, refer to the Update an attribute for a SCIM user endpoint.
Warning
Setting active: false
will suspend a user, and their handle and email will be obfuscated.
"Set SCIM information for a provisioned enterprise user" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Set SCIM information for a provisioned enterprise user" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_user_id string 必須The unique identifier of the SCIM user. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 | |||||
---|---|---|---|---|---|
schemas array of strings 必須The URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are: | |||||
externalId string 必須A unique identifier for the resource as defined by the provisioning client. | |||||
active boolean 必須Whether the user active in the IdP. | |||||
userName string 必須The username for the user. | |||||
name object | |||||
Properties of |
名前, Type, 説明 |
---|
formatted string The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. |
familyName string 必須The family name of the user. |
givenName string 必須The given name of the user. |
middleName string The middle name(s) of the user. |
displayName
string 必須A human-readable name for the user.
emails
array of objects 必須The emails for the user.
Properties of emails
名前, Type, 説明 |
---|
value string 必須The email address. |
type string 必須The type of email address. |
primary boolean 必須Whether this email address is the primary address. |
roles
array of objects The roles assigned to the user.
Properties of roles
名前, Type, 説明 |
---|
display string |
type string |
value string 必須The role value representing a user role in GitHub. 次のいずれかにできます: |
primary boolean Is the role a primary role for the user. |
"Set SCIM information for a provisioned enterprise user" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | User was updated |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
409 | Duplicate record detected |
429 | Too many requests |
500 | Internal server error |
"Set SCIM information for a provisioned enterprise user" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X PUT \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
-d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],"externalId":"E012345","active":true,"userName":"E012345","name":{"formatted":"Ms. Mona Lisa Octocat","familyName":"Octocat","givenName":"Mona","middleName":"Lisa"},"displayName":"Mona Lisa","emails":[{"value":"mlisa@example.com","type":"work","primary":true}],"roles":[{"value":"User","primary":false}]}'
User was updated
Status: 200
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "7fce0092-d52e-4f76-b727-3955bd72c939",
"externalId": "E012345",
"active": true,
"userName": "E012345",
"name": {
"formatted": "Ms. Mona Lisa Octocat",
"familyName": "Octocat",
"givenName": "Mona",
"middleName": "Lisa"
},
"displayName": "Mona Lisa",
"emails": [
{
"value": "mlisa@example.com",
"type": "work",
"primary": true
}
],
"roles": [
{
"value": "User",
"primary": false
}
],
"meta": {
"resourceType": "User",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
}
}
Update an attribute for a SCIM enterprise user
Note
SCIM provisioning for users and groups using the REST API is in public preview and subject to change.
Update a provisioned user's individual attributes.
To modify a user's attributes, you'll need to provide a Operations
JSON formatted request that includes at least one of the following actions: add, remove, or replace. For specific examples and more information on the SCIM operations format, please refer to the SCIM specification.
Note
Complex SCIM path
selectors that include filters are not supported. For example, a path
selector defined as "path": "emails[type eq \"work\"]"
will be ineffective.
Warning
Setting active: false
will suspend a user, and their handle and email will be obfuscated.
{
"Operations":[{
"op":"replace",
"value":{
"active":false
}
}]
}
"Update an attribute for a SCIM enterprise user" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Update an attribute for a SCIM enterprise user" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_user_id string 必須The unique identifier of the SCIM user. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
名前, Type, 説明 | ||||
---|---|---|---|---|
Operations array of objects 必須patch operations list | ||||
Properties of |
名前, Type, 説明 |
---|
op string 必須次のいずれかにできます: |
path string |
value string Corresponding 'value' of that field specified by 'path' |
schemas
array of strings 必須undefinedSupported values are: urn:ietf:params:scim:api:messages:2.0:PatchOp
"Update an attribute for a SCIM enterprise user" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | Success, user was updated |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
409 | Duplicate record detected |
429 | Too many requests |
500 | Internal server error |
"Update an attribute for a SCIM enterprise user" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X PATCH \
-H "Accept: application/scim+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
-d '{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"replace","path":"emails[type eq '\''work'\''].value","value":"updatedEmail@microsoft.com"},{"op":"replace","path":"name.familyName","value":"updatedFamilyName"}]}'
Success, user was updated
Status: 200
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "7fce0092-d52e-4f76-b727-3955bd72c939",
"externalId": "E012345",
"active": true,
"userName": "E012345",
"name": {
"formatted": "Ms. Mona Lisa Octocat",
"familyName": "Octocat",
"givenName": "Mona",
"middleName": "Lisa"
},
"displayName": "Mona Lisa",
"emails": [
{
"value": "mlisa@example.com",
"type": "work",
"primary": true
}
],
"roles": [
{
"value": "User",
"primary": false
}
],
"meta": {
"resourceType": "User",
"created": "2012-03-27T19:59:26.000Z",
"lastModified": "2018-03-27T19:59:26.000Z",
"location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
}
}
Delete a SCIM user from an enterprise
Note
SCIM provisioning using the REST API is in public preview and subject to change.
Suspends a SCIM user permanently from an enterprise. This action will: remove all the user's data, anonymize their login, email, and display name, erase all external identity SCIM attributes, delete the user's emails, avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings. This action is irreversible.
"Delete a SCIM user from an enterprise" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" business permissions (write)
"Delete a SCIM user from an enterprise" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
scim_user_id string 必須The unique identifier of the SCIM user. |
enterprise string 必須The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
"Delete a SCIM user from an enterprise" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
204 | User was deleted, no content |
400 | Bad request |
401 | Authorization failure |
403 | Permission denied |
404 | Resource not found |
429 | Too many requests |
500 | Internal server error |
"Delete a SCIM user from an enterprise" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com
を api.SUBDOMAIN.ghe.com
にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID
User was deleted, no content
Status: 204