Skip to content

Commit 43490d6

Browse files
cheshire137lecoursenisaacmbrown
authored
Document app-delegated SSO authorization (#63073)
Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: Isaac Brown <isaacmbrown@github.com>
1 parent 798b61e commit 43490d6

4 files changed

Lines changed: 98 additions & 0 deletions

File tree

content/authentication/authenticating-with-single-sign-on/authorizing-a-personal-access-token-for-use-with-single-sign-on.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ You must authorize your {% data variables.product.pat_v1 %} after creation befor
1919

2020
{% data reusables.saml.authorized-creds-info %}
2121

22+
Enterprise administrators can use a {% data variables.product.prodname_github_app %} to authorize credentials for multiple organizations. See [AUTOTITLE](/authentication/authenticating-with-single-sign-on/authorizing-credentials-for-single-sign-on-with-a-github-app).
23+
24+
## Authorizing a {% data variables.product.pat_v1 %}
25+
2226
{% data reusables.user-settings.access_settings %}
2327
{% data reusables.user-settings.developer_settings %}
2428
{% data reusables.user-settings.personal_access_tokens %}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Authorizing credentials for single sign-on with a GitHub App
3+
intro: 'Authorize credentials for multiple organizations by allowing an enterprise-installed {% data variables.product.prodname_github_app %} to manage single sign-on (SSO) authorizations.'
4+
versions:
5+
ghec: '*'
6+
permissions: Enterprise owners and users with the "Manage enterprise credentials" permission
7+
shortTitle: Authorize credentials with an app
8+
category:
9+
- Sign in with SSO or a passkey
10+
---
11+
12+
## About authorizing credentials with a {% data variables.product.prodname_github_app %}
13+
14+
By default, enterprise-installed {% data variables.product.prodname_github_apps %} cannot authorize credentials. To reduce the number of times that enterprise members must authorize the same credential for individual organizations, you can allow an app to authorize existing {% data variables.product.pat_v1_plural %} or verified, user-owned SSH authentication keys. Up to 50 selected organizations are allowed per request.
15+
16+
To authorize a credential for a single organization without a {% data variables.product.prodname_github_app %}, see [AUTOTITLE](/authentication/authenticating-with-single-sign-on/authorizing-a-personal-access-token-for-use-with-single-sign-on) or [AUTOTITLE](/authentication/authenticating-with-single-sign-on/authorizing-an-ssh-key-for-use-with-single-sign-on).
17+
18+
## Prerequisites
19+
20+
Before the app can authorize credentials, the following requirements must be met:
21+
22+
* The enterprise must use enterprise-level SSO.
23+
* The credential owner must be a member of every organization where the app will authorize the credential.
24+
25+
## Creating the {% data variables.product.prodname_github_app %}
26+
27+
1. Register a new app. For instructions, see [AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/registering-a-github-app#registering-a-github-app). The app must:
28+
29+
* Be owned by the enterprise or an organization in the enterprise.
30+
* Have write access to the "Enterprise credentials" permission.
31+
32+
1. Note the app's client ID, then generate and securely store a private key. See [AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps).
33+
1. Install the app on your enterprise account. See [AUTOTITLE](/apps/using-github-apps/installing-a-github-app-on-your-enterprise).
34+
1. In the URL of the app's installation page, note the installation ID. The ID is the string of numbers at the end of the `/enterprises/ENTERPRISE/settings/installations/ID` URL.
35+
36+
## Allowing a {% data variables.product.prodname_github_app %} to authorize credentials
37+
38+
{% data reusables.enterprise-accounts.access-enterprise %}
39+
{% data reusables.enterprise-accounts.security-tab %}
40+
41+
1. Under "Credentials," enable **Allow {% data variables.product.prodname_github_apps %} to authorize credentials**.
42+
43+
## Generating an installation access token
44+
45+
The app must use an enterprise installation access token to authenticate its API requests. Organization installation access tokens, user access tokens, and {% data variables.product.pat_generic_plural %} are not supported.
46+
47+
To generate an installation access token:
48+
49+
1. Use the app's client ID and private key to generate a JSON Web Token (JWT). See [AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app).
50+
1. Use the JWT and enterprise installation ID to create an installation access token. See [AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app).
51+
52+
The installation access token inherits the enterprise permissions granted to the app, cannot be scoped down, and expires after one hour.
53+
54+
## Finding credential identifiers
55+
56+
For credentials that are already authorized for an organization in your enterprise, an organization owner can use the REST API to obtain identifiers in bulk. See [AUTOTITLE](/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization).
57+
58+
In the response, use `authorized_credential_id` for a {% data variables.product.pat_v1 %}, or `fingerprint` for an SSH key. Do not use `credential_id`, which identifies the credential's authorization for that organization.
59+
60+
This endpoint does not return credentials that have not been authorized for the organization. To obtain an identifier for another credential, use one of these methods:
61+
62+
* For a {% data variables.product.pat_v1 %}, open the token from the [token settings](https://github.com/settings/tokens) page. The token ID is the number at the end of the `/settings/tokens/ID` URL. Alternatively, if the token was used for an action recorded in the enterprise audit log, an enterprise owner can find the ID in the event's `token_id` field. The ID is available in the audit log only while an enterprise-visible event authenticated with that token is retained. Share the ID, not the token value. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) and [AUTOTITLE](/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/searching-the-audit-log-for-your-enterprise).
63+
* For an SSH key, find the SHA-256 fingerprint for the verified, user-owned authentication key. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys).
64+
65+
## Authorizing a credential
66+
67+
Use the REST API to authorize the credential for selected organizations. For example:
68+
69+
```shell
70+
curl --request POST \
71+
--url "https://api.github.com/enterprises/ENTERPRISE/credential-authorizations" \
72+
--header "Accept: application/vnd.github+json" \
73+
--header "Authorization: Bearer INSTALLATION-ACCESS-TOKEN" \
74+
--header "X-GitHub-Api-Version: 2026-03-10" \
75+
--data '{
76+
"credential_id": 12345678,
77+
"credential_type": "classic_pat",
78+
"organizations": ["ORGANIZATION-1", "ORGANIZATION-2"]
79+
}'
80+
```
81+
82+
Replace `ENTERPRISE` with the enterprise slug, `INSTALLATION-ACCESS-TOKEN` with the installation access token, and `ORGANIZATION-1` and `ORGANIZATION-2` with the organization slugs. Replace `12345678` with the ID of the {% data variables.product.pat_v1 %}. To authorize an SSH key instead, replace `12345678` with the key's SHA-256 fingerprint and replace `classic_pat` with `ssh_key`.
83+
84+
For more information, see [AUTOTITLE](/rest/enterprise-admin/credential-authorizations).
85+
86+
## Disabling credential authorization by {% data variables.product.prodname_github_apps %}
87+
88+
Disabling the setting prevents apps from creating new credential authorizations. Existing authorizations remain active until they are revoked, the credential is revoked or deleted, or the credential owner loses membership in the organization.
89+
90+
You can use the same REST API to revoke authorizations that an app created through enterprise delegation.

content/authentication/authenticating-with-single-sign-on/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ children:
1313
- /about-authentication-with-single-sign-on
1414
- /authorizing-an-ssh-key-for-use-with-single-sign-on
1515
- /authorizing-a-personal-access-token-for-use-with-single-sign-on
16+
- /authorizing-credentials-for-single-sign-on-with-a-github-app
1617
- /authorizing-an-app-for-single-sign-on
1718
- /viewing-and-managing-your-active-sso-sessions
1819
shortTitle: Authenticate with SSO

data/reusables/enterprise-accounts/enterprise-apps-capabilities.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Enterprise-installed {% data variables.product.prodname_github_apps %} cannot ca
77
{%- ifversion enterprise-billing-github-app %}
88
* Manage enterprise billing, including budgets, cost centers, and usage reports. For more information, see [AUTOTITLE](/rest/billing).
99
{%- endif %}
10+
{%- ifversion ghec %}
11+
* Authorize {% data variables.product.pat_v1_plural %} and verified, user-owned SSH authentication keys for SSO in selected organizations. See [AUTOTITLE](/authentication/authenticating-with-single-sign-on/authorizing-credentials-for-single-sign-on-with-a-github-app).
12+
{%- endif %}
1013
* Call the enterprise SCIM APIs
1114

1215
Check the [changelog](https://github.blog/changelog/) for updates on new APIs and permissions for {% data variables.product.prodname_github_apps %}.

0 commit comments

Comments
 (0)