Skip to main content

Configuring SAML single sign-on for your enterprise

You can control and secure access to resources like repositories, issues, and pull requests within your enterprise's organizations by enforcing SAML single sign-on (SSO) through your identity provider (IdP).

谁可以使用此功能?

Enterprise owners can configure SAML SSO for an enterprise on GitHub Enterprise Cloud.

注意:如果企业使用 Enterprise Managed Users,则必须遵循不同的过程来配置 SAML 单一登录。 有关详细信息,请参阅“为企业托管用户配置 SAML 单一登录”。

About SAML SSO

SAML 单一登录 (SSO) 为使用 GitHub Enterprise Cloud 的组织所有者和企业所有者提供了一种控制安全访问存储库、问题和拉取请求等组织资源的方法。

如果配置了 SAML SSO,组织成员将继续在 GitHub.com 上登录到其个人帐户。 当成员访问组织内的大部分资源时,GitHub 会将成员重定向到你的 IdP 以进行身份验证。 身份验证成功后,IdP 将该成员重定向回 GitHub。 有关详细信息,请参阅“关于使用 SAML 单点登录进行身份验证”。

注意: SAML SSO 不会取代 GitHub 的正常登录过程。 除非使用 Enterprise Managed Users,否则成员将继续在 GitHub.com 上登录到其个人帐户,并且每个个人帐户都将链接到 IdP 中的外部标识。

For more information, see "关于使用 SAML 单一登录进行的标识和访问管理."

企业所有者可以通过 SAML IdP 跨企业帐户拥有的所有组织启用 SAML SSO 和集中式身份验证。 为企业帐户启用 SAML SSO 后,默认情况下会为您的企业帐户拥有的所有组织实施 SAML SSO。 所有成员都需要使用 SAML SSO 进行身份验证才能访问其所属的组织,并且企业所有者在访问企业帐户时需要使用 SAML SSO 进行身份验证。

要在 GitHub Enterprise Cloud 上访问每个组织的资源,成员必须在其浏览器中启动 SAML 会话。 要使用 API 和 Git 访问每个组织的受保护资源,成员必须使用被授权在组织中使用的 personal access token 或 SSH 密钥。 企业所有者可以随时查看和撤销成员链接的身份、活动的会话或授权的凭据。 For more information, see "查看和管理用户对企业的 SAML 访问."

注意:无法为企业帐户配置 SCIM,除非已为 Enterprise Managed Users 创建帐户。 有关详细信息,请参阅“关于 Enterprise Managed Users”。

如果不使用 Enterprise Managed Users,并且想要使用 SCIM 预配,则必须在组织级别而不是企业级别配置 SAML SSO。 有关详细信息,请参阅“关于使用 SAML 单一登录进行的标识和访问管理”。

禁用 SAML SSO 后,所有关联的外部标识将从 GitHub Enterprise Cloud 中删除。

启用 SAML SSO 后,可能需要撤销 OAuth app 和 GitHub App 授权并重新授权,然后才能访问组织。 有关详细信息,请参阅“授权 OAuth 应用”。

Supported identity providers

GitHub Enterprise Cloud 支持 SAML SSO 与采用 SAML 2.0 标准的 IdP 一起使用。 有关详细信息,请参阅 OASIS 网站上的 SAML Wiki

GitHub 官方支持和内部测试以下 IdP。

  • Microsoft Active Directory 联合身份验证服务 (AD FS)
  • Microsoft Entra ID(以前称为 Azure AD)
  • Okta
  • OneLogin
  • PingOne
  • Shibboleth

For more information about connecting Microsoft Entra ID (previously known as Azure AD) to your enterprise, see Tutorial: Microsoft Entra SSO integration with GitHub Enterprise Cloud - Enterprise Account in Microsoft Docs.

Enforcing SAML single-sign on for organizations in your enterprise account

When you enforce SAML SSO for your enterprise, the enterprise configuration will override any existing organization-level SAML configurations. 如果企业帐户拥有的任何组织已配置为使用 SAML SSO,则为企业帐户启用 SAML SSO 时,有一些特殊注意事项。 For more information, see "将你的 SAML 配置从组织切换到企业帐户."

When you enforce SAML SSO for an organization, GitHub removes any members of the organization that have not authenticated successfully with your SAML IdP. When you require SAML SSO for your enterprise, GitHub does not remove members of the enterprise that have not authenticated successfully with your SAML IdP. The next time a member accesses the enterprise's resources, the member must authenticate with your SAML IdP.

For more detailed information about how to enable SAML using Okta, see "使用 Okta 为企业配置 SAML 单点登录."

  1. 在 GitHub 的右上角,单击你的个人资料照片,然后单击“你的企业”****。

  2. 在企业列表中,单击您想要查看的企业。

  3. 在页面左侧的企业帐户边栏中,单击 设置”。

  4. 在“ 设置”下,单击“身份验证安全性” 。

  5. (可选)若要在更改设置之前查看企业帐户中所有组织的当前配置,请单击“ 查看组织的当前配置”。

    企业设置中某策略的屏幕截图。 用橙色边框突出显示了标记为“查看组织的当前配置”的链接。

  6. Under "SAML single sign-on", select Require SAML authentication.

  7. In the Sign on URL field, type the HTTPS endpoint of your IdP for single sign-on requests. This value is available in your IdP configuration.

  8. Optionally, in the Issuer field, type your SAML issuer URL to verify the authenticity of sent messages.

  9. Under Public Certificate, paste a certificate to verify SAML responses. This is the public key corresponding to the private key used to sign SAML responses.

    To find the certificate, refer to the documentation for your IdP. Some IdPs call this an X.509 certificate.

  10. 在你的公共证书下,在当前签名和摘要方法的右侧,单击

    SAML 设置中当前签名方法和摘要方法的屏幕截图。 铅笔图标以橙色轮廓突出显示。

  11. 选择“签名方法”和“摘要方法”下拉菜单,然后单击 SAML 颁发者使用的哈希算法。

  12. Before enabling SAML SSO for your enterprise, to ensure that the information you've entered is correct, click Test SAML configuration . 此测试使用服务提供商发起(SP 发起的)身份验证,并且必须先成功,然后才能保存 SAML 设置。

  13. Click Save.

  14. 要确保身份提供程序将来不可用时仍可在 GitHub.com 上访问企业,请单击“下载”、“打印”或“复制”以保存恢复代码************。 有关详细信息,请参阅“下载企业帐户的单一登录恢复代码”。

Further reading