diff --git a/docs/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/configure-azure-ad.md b/docs/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/configure-azure-ad.md index 49aa4638581..14c2abcf6c8 100644 --- a/docs/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/configure-azure-ad.md +++ b/docs/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/configure-azure-ad.md @@ -2,12 +2,6 @@ title: Configure Azure AD --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - - - - ## Microsoft Graph API Microsoft Graph API is now the flow through which you will set up Azure AD. The below sections will assist [new users](#new-user-setup) in configuring Azure AD with a new instance as well as assist existing Azure app owners in [migrating to the new flow](#migrating-from-azure-ad-graph-api-to-microsoft-graph-api). @@ -29,7 +23,8 @@ Configuring Rancher to allow your users to authenticate with their Azure AD acco :::tip -Before you start, we recommend creating an empty text file. You can use this file to copy values from Azure that you'll paste into Rancher later. +Before you start, open two browser tabs: one for Rancher, one for the Azure portal. That will help in easily copying and pasting +configuration values from the portal to Rancher. ::: @@ -42,9 +37,7 @@ Before enabling Azure AD within Rancher, you must register Rancher with Azure. 1. Use search to open the **App registrations** service. - ![Open App Registrations](/img/search-app-registrations.png) - -1. Click **New registrations** and complete the **Create** form. +1. Click **New registration** and complete the form. ![New App Registration](/img/new-app-registration.png) @@ -83,20 +76,17 @@ From the Azure portal, create a client secret. Rancher will use this key to auth ![Open Rancher Registration](/img/open-rancher-app-reg.png) -1. From the navigation pane on left, click **Certificates and Secrets**. +1. From the navigation pane on left, click **Certificates & secrets**. 1. Click **New client secret**. ![Create new client secret](/img/new-client-secret.png) 1. Enter a **Description** (something like `Rancher`). 1. Select duration for the key from the options under **Expires**. This drop-down sets the expiration date for the key. Shorter durations are more secure, but require you to create a new key after expiration. +Note that users won't be able to log in to Rancher when it detects that the application secret has expired, so rotate the secret in Azure and update in Rancher before it expires. 1. Click **Add** (you don't need to enter a value—it will automatically populate after you save). -1. Copy the key value and save it to an [empty text file](#tip). - - You'll enter this key into the Rancher UI later as your **Application Secret**. - - You won't be able to access the key value again within the Azure UI. +1. You'll enter this key into the Rancher UI later as your **Application Secret**. Since you won't be able to access the key value again within the Azure UI, keep this window open for the rest of the setup process. #### 3. Set Required Permissions for Rancher @@ -104,65 +94,55 @@ Next, set API permissions for Rancher within Azure. :::caution -Ensure that you set the permissions of type Application and NOT Delegated. Otherwise, you may not be able to login to Azure AD. This issue will persist even after you disable/re-enable Azure AD and will require an hour wait, or manual deletion of a cache value to resolve. +Ensure that you set the permissions of type Application and NOT Delegated. Otherwise, you may not be able to login to Azure AD. ::: -1. From the navigation pane on left, select **API permissions**. - - ![Open Required Permissions](/img/select-req-permissions.png) +1. From the navigation pane on the left, select **API permissions**. 1. Click **Add a permission**. -1. From the **Microsoft Graph**, select the following **Application Permissions**: - - `Group.Read.All` - - `User.Read.All` +1. From the Microsoft Graph API, select the following **Application Permissions**: `Directory.Read.All` ![Select API Permissions](/img/api-permissions.png) -1. Return to **API permissions** in the left nav bar. From there, click **Grant admin consent**. Then click **Yes**. +1. Return to **API permissions** in the left nav bar. From there, click **Grant admin consent**. Then click **Yes**. The app's permissions should look like the following: - :::note +![Open Required Permissions](/img/select-req-permissions.png) - You must be signed in as an Azure administrator to successfully save your permission settings. +:::note - ::: +Rancher does not validate the permissions you grant to the app in Azure. We only support the use of the `Directory.Read.All` application permission. + +::: #### 4. Copy Azure Application Data -As your final step in Azure, copy the data that you'll use to configure Rancher for Azure AD authentication and paste it into an empty text file. +![Application ID](/img/app-configuration.png) 1. Obtain your Rancher **Tenant ID**. 1. Use search to open **App registrations**. - ![Open App Registrations](/img/search-app-registrations.png) - 1. Find the entry you created for Rancher. - 1. Copy the **Directory ID** and paste it into your [text file](#tip). - - ![Tenant ID](/img/tenant-id.png) - - - You'll paste this value into Rancher as your **Tenant ID**. + 1. Copy the **Directory ID** and paste it into Rancher as your **Tenant ID**. 1. Obtain your Rancher **Application (Client) ID**. - 2.1. Use search to open **App registrations** (if not already there). + 1. Use search to open **App registrations** (if not already there). - 2.2. In **Overview**, find the entry you created for Rancher. + 1. In **Overview**, find the entry you created for Rancher. - 2.3. Copy the **Application (Client) ID** and paste it to your [text file](#tip). + 1. Copy the **Application (Client) ID** and paste it into Rancher as your **Application ID**. - ![Application ID](/img/application-client-id.png) - -1. Your endpoint options will typically be [Standard](#global) and [China](#china). With these options, you need only enter the **Tenant ID**, **Application ID**, and **Application Secret** (Rancher will take care of the rest). +1. Your endpoint options will typically be either [Standard](#global) or [China](#china). With these options, you only enter the **Tenant ID**, **Application ID**, and **Application Secret**. ![Standard Endpoint Options](/img/tenant-application-id-secret.png) **For Custom Endpoints:** -**Warning:** Custom Endpoints are not supported nor fully tested by Rancher. +**Warning:** Custom Endpoints are not tested or fully supported by Rancher. You will need to also manually enter the Graph, Token, and Auth Endpoints. @@ -170,7 +150,7 @@ You will need to also manually enter the Graph, Token, and Auth Endpoints. ![Click Endpoints](/img/endpoints.png) -- Copy the following endpoints to your clipboard and paste them into your [text file](#tip) (these values will be your Rancher endpoint values). Make sure to copy the v1 version of the endpoints. +- Note the following endpoints - these values will be your Rancher endpoint values. Make sure to use the v1 version of the endpoints. - **Microsoft Graph API endpoint** (Graph Endpoint) - **OAuth 2.0 token endpoint (v1)** (Token Endpoint) - **OAuth 2.0 authorization endpoint (v1)** (Auth Endpoint) @@ -179,8 +159,6 @@ You will need to also manually enter the Graph, Token, and Auth Endpoints. From the Rancher UI, enter information about your AD instance hosted in Azure to complete configuration. -Enter the values that you copied to your [text file](#tip). - 1. Log into Rancher. 1. In the top left corner, click **☰ > Users & Authentication**. 1. In the left navigation menu, click **Auth Provider**. @@ -209,7 +187,7 @@ The following table maps the custom config values you copied in the Azure portal **Important:** When entering the Graph Endpoint in a custom config, remove the tenant ID from the URL, like below: -https://graph.microsoft.com/abb5adde-bee8-4821-8b03-e63efdc7701c +https://graph.microsoft.com/abb5adde-bee8-4821-8b03-e63efdc7701c 1. Click **Enable**. @@ -218,14 +196,21 @@ The following table maps the custom config values you copied in the Azure portal ### Migrating from Azure AD Graph API to Microsoft Graph API -Since [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) was deprecated in June 2022 and will be retired on June 30, 2023, users should update their Azure AD App to use the new [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) in Rancher. +Since [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) was deprecated in June 2020 +and will be retired in June 2023, admins should update their Azure AD App to use the new +[Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) in Rancher. +This needs to be done well in advance of the endpoint being retired. +If Rancher is still configured to use the old Azure AD Graph API when it is retired, users may not be able to log into Rancher using Azure AD. #### Updating Endpoints in the Rancher UI ->**Important:** Admins should create a [backup](../../../new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher.md) right before they commit to the endpoint migration in Step 4 below. +:::caution -1. Update the permissions of your Azure AD app registration as described [here](#3-set-required-permissions-for-rancher). -**This is critical.** +Admins should create a [backup](../../../new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher.md) right before they commit to the endpoint migration described below. + +::: + +1. Update the permissions of your Azure AD app registration as described [here](#3-set-required-permissions-for-rancher). This is critical. 1. Log into Rancher. @@ -257,7 +242,7 @@ If you need to roll back your migration, please note the following: 1. Azure app owners who want to rotate the Application Secret will need to also rotate it in Rancher as Rancher does not automatically update the Application Secret when it is changed in Azure. In Rancher, note that it is stored in a Kubernetes secret called `azureadconfig-applicationsecret` which is in the `cattle-global-data` namespace. -1. **Caution:** If admins upgrade to Rancher v2.6.7 with an existing Azure AD setup and choose to disable the auth provider, they won't be able to restore the previous setup and also will not be able to set up Azure AD anew using the old flow. Admins will then need to register again with the new auth flow. Rancher now uses the new Graph API and, therefore, users need set up the [proper permissions in the Azure portal](#3-set-required-permissions-for-rancher). +1. **Caution:** If admins upgrade to Rancher v2.7.0+ with an existing Azure AD setup and choose to disable the auth provider, they won't be able to restore the previous setup and also will not be able to set up Azure AD anew using the old flow. Admins will then need to register again with the new auth flow. Rancher now uses the new Graph API and, therefore, users need set up the [proper permissions in the Azure portal](#3-set-required-permissions-for-rancher). #### Global: @@ -267,7 +252,6 @@ Auth Endpoint | https://login.microsoftonline.com/{tenantID}/oauth2/authorize Endpoint | https://login.microsoftonline.com/ Graph Endpoint | https://graph.windows.net/ Token Endpoint | https://login.microsoftonline.com/{tenantID}/oauth2/token ---- Rancher Field | New Endpoints ---------------- | ------------------------------------------------------------------ @@ -284,7 +268,6 @@ Auth Endpoint | https://login.chinacloudapi.cn/{tenantID}/oauth2/authorize Endpoint | https://login.chinacloudapi.cn/ Graph Endpoint | https://graph.chinacloudapi.cn/ Token Endpoint | https://login.chinacloudapi.cn/{tenantID}/oauth2/token ---- Rancher Field | New Endpoints ---------------- | ------------------------------------------------------------------------- @@ -294,22 +277,16 @@ Graph Endpoint | https://microsoftgraph.chinacloudapi.cn Token Endpoint | https://login.partner.microsoftonline.cn/{tenantID}/oauth2/v2.0/token - - - -## Azure AD Graph API +## Deprecated Azure AD Graph API >**Important:** > >- The [Azure AD Graph API](https://docs.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview) was deprecated in June 2022 and will be retired at the end of 2022. We will update our docs to advise the community when it is retired. Rancher now uses the [Microsoft Graph API](https://docs.microsoft.com/en-us/graph/use-the-api) as the new flow to set up Azure AD as the external auth provider. > > ->- For new users, or existing users who wish to migrate, refer to the new flow instructions on the Rancher v2.6.7 tab. +>- For new users, or existing users who wish to migrate, refer to the new flow instructions for Rancher v2.7.0+. > > ->- For existing users who do not wish to upgrade to v2.6.7 after the Azure AD Graph API is retired, they will need to either: +>- For existing users who do not wish to upgrade to v2.7.0+ after the Azure AD Graph API is retired, they will need to either: - Use the built-in Rancher auth or - Use another third-party auth system and set that up in Rancher. Please see the [authentication docs](../../../../pages-for-subheaders/authentication-config.md) to learn how to configure other open authentication providers. - - - diff --git a/static/img/api-permissions.png b/static/img/api-permissions.png index e21b79be72f..7043ee8a852 100644 Binary files a/static/img/api-permissions.png and b/static/img/api-permissions.png differ diff --git a/static/img/app-configuration.png b/static/img/app-configuration.png new file mode 100644 index 00000000000..11a2a69e7e2 Binary files /dev/null and b/static/img/app-configuration.png differ diff --git a/static/img/application-client-id.png b/static/img/application-client-id.png index 62513cded67..5231caa17d0 100644 Binary files a/static/img/application-client-id.png and b/static/img/application-client-id.png differ diff --git a/static/img/azure-update-popup.png b/static/img/azure-update-popup.png index 0ec6a913714..0cf0053c313 100644 Binary files a/static/img/azure-update-popup.png and b/static/img/azure-update-popup.png differ diff --git a/static/img/endpoints.png b/static/img/endpoints.png index c3a24838f1b..8e610733f6f 100644 Binary files a/static/img/endpoints.png and b/static/img/endpoints.png differ diff --git a/static/img/new-app-registration.png b/static/img/new-app-registration.png index f4bfa450bac..da339213791 100644 Binary files a/static/img/new-app-registration.png and b/static/img/new-app-registration.png differ diff --git a/static/img/new-client-secret.png b/static/img/new-client-secret.png index 7565405d74f..9556043d822 100644 Binary files a/static/img/new-client-secret.png and b/static/img/new-client-secret.png differ diff --git a/static/img/rancher-button-to-update.png b/static/img/rancher-button-to-update.png index 431e449d0e2..b5c8b4af4ed 100644 Binary files a/static/img/rancher-button-to-update.png and b/static/img/rancher-button-to-update.png differ diff --git a/static/img/rancher-ui-azure-update.png b/static/img/rancher-ui-azure-update.png index d179cc5be04..d547864692c 100644 Binary files a/static/img/rancher-ui-azure-update.png and b/static/img/rancher-ui-azure-update.png differ diff --git a/static/img/search-app-registrations.png b/static/img/search-app-registrations.png index da4477ed548..d547976c739 100644 Binary files a/static/img/search-app-registrations.png and b/static/img/search-app-registrations.png differ diff --git a/static/img/select-req-permissions.png b/static/img/select-req-permissions.png index 2684a77b17a..48853eb0d1e 100644 Binary files a/static/img/select-req-permissions.png and b/static/img/select-req-permissions.png differ diff --git a/static/img/tenant-application-id-secret.png b/static/img/tenant-application-id-secret.png index 12b47a5adf5..5a03f00ba3d 100644 Binary files a/static/img/tenant-application-id-secret.png and b/static/img/tenant-application-id-secret.png differ