|
| 1 | +--- |
| 2 | +title: 'Tutorial: Azure Active Directory integration with GitHub | Microsoft Docs' |
| 3 | +description: Learn how to configure single sign-on between Azure Active Directory and GitHub. |
| 4 | +services: active-directory |
| 5 | +documentationCenter: na |
| 6 | +author: jeevansd |
| 7 | +manager: femila |
| 8 | +ms.reviewer: joflore |
| 9 | + |
| 10 | +ms.assetid: 8761f5ca-c57c-4a7e-bf14-ac0421bd3b5e |
| 11 | +ms.service: active-directory |
| 12 | +ms.component: saas-app-tutorial |
| 13 | +ms.workload: identity |
| 14 | +ms.tgt_pltfrm: na |
| 15 | +ms.devlang: na |
| 16 | +ms.topic: article |
| 17 | +ms.date: 08/23/2018 |
| 18 | +ms.author: jeedes |
| 19 | + |
| 20 | +--- |
| 21 | +# Tutorial: Azure Active Directory integration with GitHub |
| 22 | + |
| 23 | +In this tutorial, you learn how to integrate GitHub with Azure Active Directory (Azure AD). |
| 24 | + |
| 25 | +Integrating GitHub with Azure AD provides you with the following benefits: |
| 26 | + |
| 27 | +- You can control in Azure AD who has access to GitHub. |
| 28 | +- You can enable your users to automatically get signed-on to GitHub (Single Sign-On) with their Azure AD accounts. |
| 29 | +- You can manage your accounts in one central location - the Azure portal. |
| 30 | + |
| 31 | +If you want to know more details about SaaS app integration with Azure AD, see [what is application access and single sign-on with Azure Active Directory](../manage-apps/what-is-single-sign-on.md). |
| 32 | + |
| 33 | +## Prerequisites |
| 34 | + |
| 35 | +To configure Azure AD integration with GitHub, you need the following items: |
| 36 | + |
| 37 | +- An Azure AD subscription |
| 38 | +- A GitHub single sign-on enabled subscription |
| 39 | + |
| 40 | +> [!NOTE] |
| 41 | +> To test the steps in this tutorial, we do not recommend using a production environment. |
| 42 | +
|
| 43 | +To test the steps in this tutorial, you should follow these recommendations: |
| 44 | + |
| 45 | +- Do not use your production environment, unless it is necessary. |
| 46 | +- If you don't have an Azure AD trial environment, you can [get a one-month trial](https://azure.microsoft.com/pricing/free-trial/). |
| 47 | + |
| 48 | +## Scenario description |
| 49 | + |
| 50 | +In this tutorial, you test Azure AD single sign-on in a test environment. |
| 51 | +The scenario outlined in this tutorial consists of two main building blocks: |
| 52 | + |
| 53 | +1. Adding GitHub from the gallery |
| 54 | +2. Configuring and testing Azure AD single sign-on |
| 55 | + |
| 56 | +## Adding GitHub from the gallery |
| 57 | + |
| 58 | +To configure the integration of GitHub into Azure AD, you need to add GitHub from the gallery to your list of managed SaaS apps. |
| 59 | + |
| 60 | +**To add GitHub from the gallery, perform the following steps:** |
| 61 | + |
| 62 | +1. In the **[Azure portal](https://portal.azure.com)**, on the left navigation panel, click **Azure Active Directory** icon. |
| 63 | + |
| 64 | + ![The Azure Active Directory button][1] |
| 65 | + |
| 66 | +2. Navigate to **Enterprise applications**. Then go to **All applications**. |
| 67 | + |
| 68 | + ![The Enterprise applications blade][2] |
| 69 | + |
| 70 | +3. To add new application, click **New application** button on the top of dialog. |
| 71 | + |
| 72 | + ![The New application button][3] |
| 73 | + |
| 74 | +4. In the search box, type **GitHub**, select **GitHub** from result panel then click **Add** button to add the application. |
| 75 | + |
| 76 | +  |
| 77 | + |
| 78 | +## Configure and test Azure AD single sign-on |
| 79 | + |
| 80 | +In this section, you configure and test Azure AD single sign-on with GitHub based on a test user called "Britta Simon". |
| 81 | + |
| 82 | +For single sign-on to work, Azure AD needs to know what the counterpart user in GitHub is to a user in Azure AD. In other words, a link relationship between an Azure AD user and the related user in GitHub needs to be established. |
| 83 | + |
| 84 | +To configure and test Azure AD single sign-on with GitHub, you need to complete the following building blocks: |
| 85 | + |
| 86 | +1. **[Configure Azure AD Single Sign-On](#configure-azure-ad-single-sign-on)** - to enable your users to use this feature. |
| 87 | +2. **[Create an Azure AD test user](#create-an-azure-ad-test-user)** - to test Azure AD single sign-on with Britta Simon. |
| 88 | +3. **[Create a GitHub test user](#create-a-github-test-user)** - to have a counterpart of Britta Simon in GitHub that is linked to the Azure AD representation of user. |
| 89 | +4. **[Assign the Azure AD test user](#assign-the-azure-ad-test-user)** - to enable Britta Simon to use Azure AD single sign-on. |
| 90 | +5. **[Test single sign-on](#test-single-sign-on)** - to verify whether the configuration works. |
| 91 | + |
| 92 | +### Configure Azure AD single sign-on |
| 93 | + |
| 94 | +In this section, you enable Azure AD single sign-on in the Azure portal and configure single sign-on in your GitHub application. |
| 95 | + |
| 96 | +**To configure Azure AD single sign-on with GitHub, perform the following steps:** |
| 97 | + |
| 98 | +1. In the Azure portal, on the **GitHub** application integration page, click **Single sign-on**. |
| 99 | + |
| 100 | + ![Configure single sign-on link][4] |
| 101 | + |
| 102 | +2. On the **Single sign-on** dialog, select **Mode** as **SAML-based Sign-on** to enable single sign-on. |
| 103 | + |
| 104 | +  |
| 105 | + |
| 106 | +3. On the **GitHub Domain and URLs** section, perform the following steps: |
| 107 | + |
| 108 | +  |
| 109 | + |
| 110 | + a. In the **Sign on URL** textbox, type a URL using the following pattern: `https://github.com/orgs/<entity-id>/sso` |
| 111 | + |
| 112 | + b. In the **Identifier (Entity ID)** textbox, type a URL using the following pattern: `https://github.com/orgs/<entity-id>` |
| 113 | + |
| 114 | + > [!NOTE] |
| 115 | + > Please note that these are not the real values. You have to update these values with the actual Sign on URL and Identifier. Here we suggest you to use the unique value of string in the Identifier. Go to GitHub Admin section to retrieve these values. |
| 116 | + |
| 117 | +4. On the **User Attributes** section, select **User Identifier** as user.mail. |
| 118 | + |
| 119 | +  |
| 120 | + |
| 121 | +5. On the **SAML Signing Certificate** section, click **Certificate (Base64)** and then save the certificate file on your computer. |
| 122 | + |
| 123 | +  |
| 124 | + |
| 125 | +6. Click **Save** button. |
| 126 | + |
| 127 | +  |
| 128 | + |
| 129 | +7. On the **GitHub Configuration** section, click **Configure GitHub** to open **Configure sign-on** window. Copy the **Sign-Out URL, SAML Entity ID, and SAML Single Sign-On Service URL** from the **Quick Reference section.** |
| 130 | + |
| 131 | +  |
| 132 | + |
| 133 | +8. In a different web browser window, log into your GitHub organization site as an administrator. |
| 134 | + |
| 135 | +9. Navigate to **Settings** and click **Security** |
| 136 | + |
| 137 | +  |
| 138 | + |
| 139 | +10. Check the **Enable SAML authentication** box, revealing the Single Sign-on configuration fields. Then, use the single sign-on URL value to update the Single sign-on URL on Azure AD configuration. |
| 140 | + |
| 141 | +  |
| 142 | + |
| 143 | +11. Configure the following fields: |
| 144 | + |
| 145 | + a. In the **Sign on URL** textbox, paste **SAML Single sign-on Service URL** value which you have copied from the Azure portal. |
| 146 | + |
| 147 | + b. In the **Issuer** textbox, paste **SAML Entity ID** value which you have copied from the Azure portal. |
| 148 | + |
| 149 | + c. Open the downloaded certificate from Azure portal in notepad, paste the content into the **Public Certificate** textbox. |
| 150 | + |
| 151 | +  |
| 152 | + |
| 153 | +12. Click on **Test SAML configuration** to confirm that no validation failures or errors during SSO. |
| 154 | + |
| 155 | +  |
| 156 | + |
| 157 | +13. Click **Save** |
| 158 | + |
| 159 | +> [!NOTE] |
| 160 | +> Single sign-on in GitHub authenticates to a specific organization in GitHub and does not replace the authentication of GitHub itself. Therefore, if the user's GitHub.com session has expired, you may be asked to authenticate with GitHub's ID/password during the single sign-on process. |
| 161 | +
|
| 162 | +### Create an Azure AD test user |
| 163 | + |
| 164 | +The objective of this section is to create a test user in the Azure portal called Britta Simon. |
| 165 | + |
| 166 | + ![Create an Azure AD test user][100] |
| 167 | + |
| 168 | +**To create a test user in Azure AD, perform the following steps:** |
| 169 | + |
| 170 | +1. In the Azure portal, in the left pane, click the **Azure Active Directory** button. |
| 171 | + |
| 172 | +  |
| 173 | + |
| 174 | +2. To display the list of users, go to **Users and groups**, and then click **All users**. |
| 175 | + |
| 176 | +  |
| 177 | + |
| 178 | +3. To open the **User** dialog box, click **Add** at the top of the **All Users** dialog box. |
| 179 | + |
| 180 | +  |
| 181 | + |
| 182 | +4. In the **User** dialog box, perform the following steps: |
| 183 | + |
| 184 | +  |
| 185 | + |
| 186 | + a. In the **Name** box, type **BrittaSimon**. |
| 187 | + |
| 188 | + b. In the **User name** box, type the email address of user Britta Simon. |
| 189 | + |
| 190 | + c. Select the **Show Password** check box, and then write down the value that's displayed in the **Password** box. |
| 191 | + |
| 192 | + d. Click **Create**. |
| 193 | + |
| 194 | +### Create a GitHub test user |
| 195 | + |
| 196 | +The objective of this section is to create a user called Britta Simon in GitHub. GitHub supports automatic user provisioning, which is by default enabled. You can find more details [here](github-provisioning-tutorial.md) on how to configure automatic user provisioning. |
| 197 | + |
| 198 | +**If you need to create user manually, perform following steps:** |
| 199 | + |
| 200 | +1. Log in to your GitHub company site as an administrator. |
| 201 | + |
| 202 | +2. Click **People**. |
| 203 | + |
| 204 | +  |
| 205 | + |
| 206 | +3. Click **Invite member**. |
| 207 | + |
| 208 | +  |
| 209 | + |
| 210 | +4. On the **Invite member** dialog page, perform the following steps: |
| 211 | + |
| 212 | + a. In the **Email** textbox, type the email address of Britta Simon account. |
| 213 | + |
| 214 | +  |
| 215 | + |
| 216 | + b. Click **Send Invitation**. |
| 217 | + |
| 218 | +  |
| 219 | + |
| 220 | + > [!NOTE] |
| 221 | + > The Azure Active Directory account holder will receive an email and follow a link to confirm their account before it becomes active. |
| 222 | + |
| 223 | +### Assign the Azure AD test user |
| 224 | + |
| 225 | +In this section, you enable Britta Simon to use Azure single sign-on by granting access to GitHub. |
| 226 | + |
| 227 | +![Assign the user role][200] |
| 228 | + |
| 229 | +**To assign Britta Simon to GitHub, perform the following steps:** |
| 230 | + |
| 231 | +1. In the Azure portal, open the applications view, and then navigate to the directory view and go to **Enterprise applications** then click **All applications**. |
| 232 | + |
| 233 | + ![Assign User][201] |
| 234 | + |
| 235 | +2. In the applications list, select **GitHub**. |
| 236 | + |
| 237 | +  |
| 238 | + |
| 239 | +3. In the menu on the left, click **Users and groups**. |
| 240 | + |
| 241 | + ![The "Users and groups" link][202] |
| 242 | + |
| 243 | +4. Click **Add** button. Then select **Users and groups** on **Add Assignment** dialog. |
| 244 | + |
| 245 | + ![The Add Assignment pane][203] |
| 246 | + |
| 247 | +5. On **Users and groups** dialog, select **Britta Simon** in the Users list. |
| 248 | + |
| 249 | +6. Click **Select** button on **Users and groups** dialog. |
| 250 | + |
| 251 | +7. Click **Assign** button on **Add Assignment** dialog. |
| 252 | + |
| 253 | +### Test single sign-on |
| 254 | + |
| 255 | +In this section, you test your Azure AD single sign-on configuration using the Access Panel. |
| 256 | + |
| 257 | +When you click the GitHub tile in the Access Panel, you should get automatically signed-on to your GitHub application. |
| 258 | +For more information about the Access Panel, see [Introduction to the Access Panel](../user-help/active-directory-saas-access-panel-introduction.md). |
| 259 | + |
| 260 | +## Additional resources |
| 261 | + |
| 262 | +* [List of Tutorials on How to Integrate SaaS Apps with Azure Active Directory](tutorial-list.md) |
| 263 | +* [What is application access and single sign-on with Azure Active Directory?](../manage-apps/what-is-single-sign-on.md) |
| 264 | + |
| 265 | +<!--Image references--> |
| 266 | + |
| 267 | +[1]: ./media/github-tutorial/tutorial_general_01.png |
| 268 | +[2]: ./media/github-tutorial/tutorial_general_02.png |
| 269 | +[3]: ./media/github-tutorial/tutorial_general_03.png |
| 270 | +[4]: ./media/github-tutorial/tutorial_general_04.png |
| 271 | + |
| 272 | +[100]: ./media/github-tutorial/tutorial_general_100.png |
| 273 | + |
| 274 | +[200]: ./media/github-tutorial/tutorial_general_200.png |
| 275 | +[201]: ./media/github-tutorial/tutorial_general_201.png |
| 276 | +[202]: ./media/github-tutorial/tutorial_general_202.png |
| 277 | +[203]: ./media/github-tutorial/tutorial_general_203.png |
0 commit comments