Tutorial: Azure Active Directory single sign-on (SSO) integration with GitHub Enterprise Cloud - Enterprise Account

In this tutorial, you'll learn how to integrate GitHub Enterprise Cloud - Enterprise Account with Azure Active Directory (Azure AD). When you integrate GitHub Enterprise Cloud - Enterprise Account with Azure AD, you can:

  • Control in Azure AD who has access to a GitHub Enterprise Account and any organizations within the Enterprise Account.

Prerequisites

To get started, you need the following items:

Scenario description

In this tutorial, you configure and test Azure AD SSO in a test environment.

  • GitHub Enterprise Cloud - Enterprise Account supports SP and IDP initiated SSO.
  • GitHub Enterprise Cloud - Enterprise Account supports Just In Time user provisioning.

To configure the integration of GitHub Enterprise Cloud - Enterprise Account into Azure AD, you need to add GitHub Enterprise Cloud - Enterprise Account from the gallery to your list of managed SaaS apps.

  1. Sign in to the Azure portal using either a work or school account, or a personal Microsoft account.
  2. On the left navigation pane, select the Azure Active Directory service.
  3. Navigate to Enterprise Applications and then select All Applications.
  4. To add new application, select New application.
  5. In the Add from the gallery section, type GitHub Enterprise Cloud - Enterprise Account in the search box.
  6. Select GitHub Enterprise Cloud - Enterprise Account from results panel and then add the app. Wait a few seconds while the app is added to your tenant.

Alternatively, you can also use the Enterprise App Configuration Wizard. In this wizard, you can add an application to your tenant, add users/groups to the app, assign roles, as well as walk through the SSO configuration as well. Learn more about Microsoft 365 wizards.

Configure and test Azure AD SSO for GitHub Enterprise Cloud - Enterprise Account

Configure and test Azure AD SSO with GitHub Enterprise Cloud - Enterprise Account using a test user called B.Simon. For SSO to work, you need to establish a link relationship between an Azure AD user and the related user in GitHub Enterprise Cloud - Enterprise Account.

To configure and test Azure AD SSO with GitHub Enterprise Cloud - Enterprise Account, perform the following steps:

  1. Configure Azure AD SSO - to enable your users to use this feature.
    1. Create an Azure AD test user - to test Azure AD single sign-on with B.Simon.
    2. Assign your Azure AD user and the test user account to the GitHub app - to enable your user account and test user B.Simon to use Azure AD single sign-on.
  2. Enable and Test SAML for the Enterprise Account and its organizations - to configure the single sign-on settings on application side.
    1. Test SSO with another enterprise account owner or organization member account - to verify whether the configuration works.

Configure Azure AD SSO

Follow these steps to enable Azure AD SSO in the Azure portal.

  1. In the Azure portal, on the GitHub Enterprise Cloud - Enterprise Account application integration page, find the Manage section and select single sign-on.

  2. On the Select a single sign-on method page, select SAML.

  3. On the Set up single sign-on with SAML page, click the pencil icon for Basic SAML Configuration to edit the settings.

    Edit Basic SAML Configuration

  4. On the Basic SAML Configuration section, if you wish to configure the application in IDP initiated mode, enter the values for the following fields:

    a. In the Identifier (Entity ID) text box, type a URL using the following pattern: https://github.com/enterprises/<ENTERPRISE-SLUG>

    b. In the Reply URL text box, type a URL using the following pattern: https://github.com/enterprises/<ENTERPRISE-SLUG>/saml/consume

  5. Click Set additional URLs and perform the following step if you wish to configure the application in SP initiated mode:

    In the Sign on URL text box, type a URL using the following pattern: https://github.com/enterprises/<ENTERPRISE-SLUG>/sso

    Note

    Replace <ENTERPRISE-SLUG> with the actual name of your GitHub Enterprise Account.

  6. On the Set up single sign-on with SAML page, in the SAML Signing Certificate section, find Certificate (Base64) and select Download to download the certificate and save it on your computer.

    The Certificate download link

  7. On the Set up GitHub Enterprise Cloud - Enterprise Account section, copy the appropriate URL(s) based on your requirement.

    Copy configuration URLs

Create an Azure AD test user

In this section, you'll create a test user in the Azure portal called B.Simon.

  1. From the left pane in the Azure portal, select Azure Active Directory, select Users, and then select All users.
  2. Select New user at the top of the screen.
  3. In the User properties, follow these steps:
    1. In the Name field, enter B.Simon.
    2. In the User name field, enter the username@companydomain.extension. For example, B.Simon@contoso.com.
    3. Select the Show password check box, and then write down the value that's displayed in the Password box.
    4. Click Create.

Assign your Azure AD user and the test user account to the GitHub app

In this section, you'll enable B.Simon and your user account to use Azure single sign-on by granting access to GitHub Enterprise Cloud - Enterprise Account.

  1. In the Azure portal, select Enterprise Applications, and then select All applications.
  2. In the applications list, select GitHub Enterprise Cloud - Enterprise Account.
  3. In the app's overview page, find the Manage section and select Users and groups.
  4. Select Add user, then select Users and groups in the Add Assignment dialog.
  5. In the Users and groups dialog, select B.Simon and your user account from the Users list, then click the Select button at the bottom of the screen.
  6. If you are expecting a role to be assigned to the users, you can select it from the Select a role dropdown. If no role has been set up for this app, you see "Default Access" role selected.
  7. In the Add Assignment dialog, click the Assign button.

Enable and Test SAML for the Enterprise Account and its organizations

To configure single sign-on on the GitHub Enterprise Cloud - Enterprise Account side, follow the steps listed in this GitHub documentation.

  1. Sign in to GitHub.com with a user account that is an enterprise account owner.
  2. Copy the value from the Login URL field in the app from the Azure portal and paste it in the Sign on URL field in the GitHub Enterprise Account SAML settings.
  3. Copy the value from the Azure AD Identifier field in the app from the Azure portal and paste it in the Issuer field in the GitHub Enterprise Account SAML settings.
  4. Copy the contents of the Certificate (Base64) file you downloaded in the steps above from Azure portal and paste them in the appropriate field in the GitHub Enterprise Account SAML settings.
  5. Click the Test SAML configuration and confirm that you are able to authenticate from the GitHub Enterprise Account to Azure AD successfully.
  6. Once the test is successful, save the settings.
  7. After authenticating via SAML for the first time from the GitHub enterprise account, a linked external identity will be created in the GitHub enterprise account that associates the signed in GitHub user account with the Azure AD user account.

After you enable SAML SSO for your GitHub Enterprise Account, SAML SSO is enabled by default for all organizations owned by your Enterprise Account. All members will be required to authenticate using SAML SSO to gain access to the organizations where they are a member, and enterprise owners will be required to authenticate using SAML SSO when accessing an Enterprise Account.

Test SSO with another enterprise account owner or organization member account

After the SAML integration is set up for the GitHub enterprise account (which also applies to the GitHub organizations in the enterprise account), other enterprise account owners who are assigned to the app in Azure AD should be able to navigate to the GitHub enterprise account URL (https://github.com/enterprises/<enterprise account>), authenticate via SAML, and access the policies and settings under the GitHub enterprise account.

An organization owner for an organization in an enterprise account should be able to invite a user to join their GitHub organization. Sign in to GitHub.com with an organization owner account and follow the steps in the article to invite B.Simon to the organization. A GitHub user account will need to be created for B.Simon if one does not already exist.

To test GitHub organization access under the Enterprise Account with the B.Simon test user account:

  1. Invite B.Simon to an organization under the Enterprise Account as an organization owner.
  2. Sign in to GitHub.com using the user account you would like to link to the B.Simon Azure AD user account.
  3. Sign in to Azure AD using the B.Simon user account.
  4. Go to the GitHub organization. The user should be prompted to authenticate via SAML. After successful SAML authentication, B.Simon should be able to access organization resources.

Next steps

Once you configure GitHub Enterprise Cloud - Enterprise Account you can enforce session control, which protects exfiltration and infiltration of your organization’s sensitive data in real time. Session control extends from Conditional Access. Learn how to enforce session control with Microsoft Defender for Cloud Apps.