This document describes how to:
- Integrate GitHub Enterprise Managed Users (EMU) with Google Identity Provider .
- Perform user provisioning and deprovisioning using GitHub's SCIM REST APIs.
- Automate provisioning and deprovisioning using GitHub Actions.
Reference:
- GitHub Enterprise account with EMU enabled.
- Admin access to Google Identity Platform (or your SCIM-compliant IdP).
- SCIM Provisioning URL and OAuth Bearer Token from GitHub.
- Navigate to GitHub Enterprise Settings → Authentication Security.
- In the Provisioning section, select Configure SCIM.
- Copy the SCIM Endpoint URL and OAuth Bearer Token.
Follow these steps for Google IdP:
- Open Google Admin Console.
- Go to Apps → Web and Mobile Apps → Add App → Add Custom SAML App.
- Enter App Name: GitHub EMU.
- Set up the SAML App (though SCIM is configured separately):
- Entity ID: GitHub EMU URL.
- ACS URL: GitHub login URL.
- For Provisioning (SCIM):
- Enable Automatic User Provisioning.
- Set the SCIM API Endpoint to the GitHub SCIM Endpoint.
- Set Authorization Method to Bearer Token.
- Paste the GitHub SCIM OAuth Token.
- Map user attributes correctly:
userName→ emaildisplayName→ Full nameactive→ True
(Refer to your IdP's SCIM configuration guide for any custom mappings.)
If needed, you can provision or deprovision users manually using GitHub's SCIM API.
Endpoint:
POST https://api.github.com/scim/v2/enterprises/{enterprise}/Users
Request Headers:
Authorization: Bearer <your_token>
Accept: application/scim+json
Content-Type: application/scim+jsonSample Request Body:
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"userName": "user@example.com",
"name": {
"givenName": "First",
"familyName": "Last"
},
"emails": [
{
"primary": true,
"value": "user@example.com",
"type": "work"
}
]
}Endpoint:
DELETE https://api.github.com/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
Request Headers:
Authorization: Bearer <your_token>
Accept: application/scim+jsonNotes:
{scim_user_id}is the SCIM ID, not GitHub login.- You can retrieve the
scim_user_idusing the List SCIM Users API.
Endpoint:
GET https://api.github.com/scim/v2/enterprises/{enterprise}/Users
This will list all provisioned users along with their SCIM IDs.
You can automate the process of provisioning and deprovisioning users via GitHub Actions.
- Whenever a user is added or removed in the Google IdP App, a GitHub Action can trigger.
- The Action will call the same REST APIs to provision or deprovision the users automatically in GitHub EMU.
name: Provision GitHub EMU User
on:
workflow_dispatch:
jobs:
provision-user:
runs-on: ubuntu-latest
steps:
- name: Provision User
run: |
curl -X POST https://api.github.com/scim/v2/enterprises/${{ secrets.GITHUB_ENTERPRISE }}/Users \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/scim+json" \
-H "Content-Type: application/scim+json" \
-d '{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "user@example.com",
"name": {"givenName": "First", "familyName": "Last"},
"emails": [{"primary": true, "value": "user@example.com", "type": "work"}]
}'name: Deprovision GitHub EMU User
on:
workflow_dispatch:
jobs:
deprovision-user:
runs-on: ubuntu-latest
steps:
- name: Deprovision User
run: |
curl -X DELETE https://api.github.com/scim/v2/enterprises/${{ secrets.GITHUB_ENTERPRISE }}/Users/${{ secrets.SCIM_USER_ID }} \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/scim+json"GITHUB_TOKEN: Your GitHub OAuth token with SCIM access.GITHUB_ENTERPRISE: Your GitHub Enterprise slug.SCIM_USER_ID: SCIM ID for the user to deprovision.
- OAuth Bearer Token needs to be refreshed as per your enterprise token policy.
- SCIM provisioning will not work unless SSO login is configured and EMU is enabled.
- Deprovisioning a user via SCIM does NOT delete their historical contributions; it only disables the GitHub account.
- Use GitHub Actions carefully and limit access to secrets.
- Provision a SCIM Enterprise User API
- Delete a SCIM Enterprise User API
- Configuring SCIM Provisioning for Users
The process outlined will remain the same for other IDPs as well.