Skip to content

Commit 595a43d

Browse files
authored
Merge pull request #102534 from cephalin/1617934
#1224892
2 parents f93f76f + ee8b3d4 commit 595a43d

File tree

2 files changed

+20
-36
lines changed

2 files changed

+20
-36
lines changed

articles/app-service/configure-authentication-provider-aad.md

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,30 @@ Follow these best practices when setting up your app and authentication:
2424
## <a name="express"> </a>Configure with express settings
2525

2626
1. In the [Azure portal], search for and select **App Services**, and then select your app.
27-
1. In the left pane, under **Settings** select **Authentication / Authorization** and make sure that **App Service Authentication** is **On**.
28-
1. Select **Azure Active Directory**, and then under **Management Mode** select **Express**.
29-
1. Select **OK** to register the App Service app in Azure Active Directory. A new app registration is created.
27+
2. From the left navigation, select **Authentication / Authorization** > **On**.
28+
3. Select **Azure Active Directory** > **Express**.
3029

3130
If you want to choose an existing app registration instead:
3231

33-
1. Choose **Select an existing app** and then search for the name of a previously created app registration within your tenant.
34-
1. Select the app registration and then select **OK**.
35-
1. Then select **OK** on the Azure Active Directory settings page.
32+
1. Choose **Select Existing AD app**, then click **Azure AD App**.
33+
2. Choose an existing app registration and click **OK**.
3634

37-
By default, App Service provides authentication but doesn't restrict authorized access to your site content and APIs. You must authorize users in your app code.
38-
1. (Optional) To restrict app access only to users authenticated by Azure Active Directory, set **Action to take when request is not authenticated** to **Log in with Azure Active Directory**. When you set this functionality, your app requires all requests to be authenticated. It also redirects all unauthenticated to Azure Active Directory for authentication.
35+
3. Select **OK** to register the App Service app in Azure Active Directory. A new app registration is created.
36+
37+
![Express settings in Azure Active Directory](./media/configure-authentication-provider-aad/express-settings.png)
38+
39+
4. (Optional) By default, App Service provides authentication but doesn't restrict authorized access to your site content and APIs. You must authorize users in your app code. To restrict app access only to users authenticated by Azure Active Directory, set **Action to take when request is not authenticated** to **Log in with Azure Active Directory**. When you set this functionality, your app requires all requests to be authenticated. It also redirects all unauthenticated to Azure Active Directory for authentication.
3940

4041
> [!CAUTION]
4142
> Restricting access in this way applies to all calls to your app, which might not be desirable for apps that have a publicly available home page, as in many single-page applications. For such applications, **Allow anonymous requests (no action)** might be preferred, with the app manually starting login itself. For more information, see [Authentication flow](overview-authentication-authorization.md#authentication-flow).
42-
1. Select **Save**.
43+
5. Select **Save**.
4344

4445
## <a name="advanced"> </a>Configure with advanced settings
4546

46-
You can configure app settings manually if you want to use an Azure AD tenant that's different from the one you use to sign in to Azure. To complete this custom configuration, you'll need to:
47+
You can configure app settings manually if you want to use an app registration from a different Azure AD tenant. To complete this custom configuration:
4748

4849
1. Create a registration in Azure AD.
49-
1. Provide some of the registration details to App Service.
50+
2. Provide some of the registration details to App Service.
5051

5152
### <a name="register"> </a>Create an app registration in Azure AD for your App Service app
5253

@@ -62,7 +63,7 @@ Perform the following steps:
6263
1. Sign in to the [Azure portal], search for and select **App Services**, and then select your app. Note your app's **URL**. You'll use it to configure your Azure Active Directory app registration.
6364
1. Select **Azure Active Directory** > **App registrations** > **New registration**.
6465
1. In the **Register an application** page, enter a **Name** for your app registration.
65-
1. In **Redirect URI**, select **Web** and enter the URL of your App Service app and append the path `/.auth/login/aad/callback`. For example, `https://contoso.azurewebsites.net/.auth/login/aad/callback`.
66+
1. In **Redirect URI**, select **Web** and type `<app-url>/.auth/login/aad/callback`. For example, `https://contoso.azurewebsites.net/.auth/login/aad/callback`.
6667
1. Select **Create**.
6768
1. After the app registration is created, copy the **Application (client) ID** and the **Directory (tenant) ID** for later.
6869
1. Select **Branding**. In **Home page URL**, enter the URL of your App Service app and select **Save**.
@@ -78,24 +79,22 @@ Perform the following steps:
7879
1. (Optional) To create a client secret, select **Certificates & secrets** > **New client secret** > **Add**. Copy the client secret value shown in the page. It won't be shown again.
7980
1. (Optional) To add multiple **Reply URLs**, select **Authentication**.
8081

81-
### <a name="secrets"> </a>Add Azure Active Directory information to your App Service app
82+
### <a name="secrets"> </a>Enable Azure Active Directory in your App Service app
8283

8384
1. In the [Azure portal], search for and select **App Services**, and then select your app.
84-
1. In the left pane, under **Settings**, select **Authentication / Authorization** and make sure that **App Service Authentication** is **On**.
85+
1. In the left pane, under **Settings**, select **Authentication / Authorization** > **On**.
8586
1. (Optional) By default, App Service authentication allows unauthenticated access to your app. To enforce user authentication, set **Action to take when request is not authenticated** to **Log in with Azure Active Directory**.
86-
1. Under Authentication Providers, select **Azure Active Directory**.
87+
1. Under **Authentication Providers**, select **Azure Active Directory**.
8788
1. In **Management mode**, select **Advanced** and configure App Service authentication according to the following table:
8889

8990
|Field|Description|
9091
|-|-|
9192
|Client ID| Use the **Application (client) ID** of the app registration. |
9293
|Issuer ID| Use `https://login.microsoftonline.com/<tenant-id>`, and replace *\<tenant-id>* with the **Directory (tenant) ID** of the app registration. |
9394
|Client Secret (Optional)| Use the client secret you generated in the app registration.|
94-
|Allowed Token Audiences| If this is a cloud or server app and you want to allow authentication tokens from a web app, add the **Application ID URI** of the web app here. |
95+
|Allowed Token Audiences| If this is a cloud or server app and you want to allow authentication tokens from a web app, add the **Application ID URI** of the web app here. The configured **Client ID** is *always* implicitly considered to be an allowed audience. |
9596

96-
> [!NOTE]
97-
> The configured **Client ID** is *always* implicitly considered to be an allowed audience, regardless of how you configured the **Allowed Token Audiences**.
98-
1. Select **OK**, and then select **Save**.
97+
2. Select **OK**, and then select **Save**.
9998

10099
You're now ready to use Azure Active Directory for authentication in your App Service app.
101100

@@ -105,11 +104,11 @@ You can register native clients to allow authentication using a client library s
105104

106105
1. In the [Azure portal], select **Active Directory** > **App registrations** > **New registration**.
107106
1. In the **Register an application** page, enter a **Name** for your app registration.
108-
1. In **Redirect URI**, select **Public client (mobile & desktop)** and enter the URL of your App Service app and append the path `/.auth/login/aad/callback`. For example, `https://contoso.azurewebsites.net/.auth/login/aad/callback`.
109-
1. Select **Create**.
107+
1. In **Redirect URI**, select **Public client (mobile & desktop)** and type the URL `<app-url>/.auth/login/aad/callback`. For example, `https://contoso.azurewebsites.net/.auth/login/aad/callback`.
110108

111109
> [!NOTE]
112110
> For a Windows application, use the [package SID](../app-service-mobile/app-service-mobile-dotnet-how-to-use-client-library.md#package-sid) as the URI instead.
111+
1. Select **Create**.
113112
1. After the app registration is created, copy the value of **Application (client) ID**.
114113
1. Select **API permissions** > **Add a permission** > **My APIs**.
115114
1. Select the app registration you created earlier for your App Service app. If you don't see the app registration, make sure that you've added the **user_impersonation** scope in [Create an app registration in Azure AD for your App Service app](#register).
@@ -121,21 +120,6 @@ You have now configured a native client application that can access your App Ser
121120

122121
[!INCLUDE [app-service-mobile-related-content-get-started-users](../../includes/app-service-mobile-related-content-get-started-users.md)]
123122

124-
<!-- Images. -->
125-
126-
[0]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-webapp-url.png
127-
[1]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-aad-app_registration.png
128-
[2]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-aad-app-registration-create.png
129-
[3]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-aad-app-registration-config-appidurl.png
130-
[4]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-aad-app-registration-config-replyurl.png
131-
[5]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-aad-endpoints.png
132-
[6]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-aad-endpoints-fedmetadataxml.png
133-
[7]: ./media/app-service-mobile-how-to-configure-active-directory-authentication/app-service-webapp-auth.png
134-
[8]: ./media/configure-authentication-provider-aad/app-service-webapp-auth-config.png
135-
136-
137-
138123
<!-- URLs. -->
139124

140125
[Azure portal]: https://portal.azure.com/
141-
[alternative method]:#advanced
87.6 KB
Loading

0 commit comments

Comments
 (0)