You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-set-up-app-service-authentication/after.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Now that you have a web app running on App Service, enable authentication and au
49
49
50
50
1. On your app's left menu, select **Authentication**, and then select **Add identity provider**.
51
51
52
-
1. In the **Add an identity provider** page, for example select **Microsoft** as the **Identity provider** to sign in Microsoft and Microsoft Entra identities.
52
+
1. In the **Add an identity provider** page, select **Microsoft** as the **Identity provider** to sign in Microsoft and Microsoft Entra identities.
53
53
54
54
1. For **Tenant type**, select **Workforce configuration (current tenant)** for employees and business guests.
55
55
@@ -81,7 +81,7 @@ Now that you have a web app running on App Service, enable authentication and au
81
81
82
82
1. On your app's left menu, select **Authentication**, and then select **Add identity provider**.
83
83
84
-
1. In the **Add an identity provider** page, for example select **Microsoft** as the **Identity provider** to sign in Microsoft and Microsoft Entra identities.
84
+
1. In the **Add an identity provider** page, select **Microsoft** as the **Identity provider** to sign in Microsoft and Microsoft Entra identities.
85
85
86
86
1. For **Tenant type**, select **External configuration** for external users.
87
87
@@ -131,13 +131,15 @@ Now that you have a web app running on App Service, enable authentication and au
131
131
132
132
## 4. Verify limited access to the web app
133
133
134
-
When you enabled the App Service authentication/authorization module in the previous section, an app registration was created in your Microsoft Entra tenant. The app registration has the same display name as your web app.
134
+
When you enabled the App Service authentication/authorization module in the previous section, an app registration was created in your workforce or external tenant. The app registration has the same display name as your web app.
135
135
136
-
1. To check the settings, go to the [Microsoft Entra admin center](https://entra.microsoft.com) and select **Applications** and then **App registrations** from the menu.
136
+
1. To check the settings, sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as at least an [Application Developer](/entra/identity/role-based-access-control/permissions-reference#application-developer). If necessary, use the **Settings** icon in the top menu to switch to the customer or external tenant with your web app from the **Directories** + **subscriptions** menu. When you are in the correct tenant:
137
+
138
+
1. Browse to **Identity** > **Applications** > **App registrations** and select **Applications** > **App registrations** from the menu.
137
139
1. Select the app registration that was created.
138
140
1. In the overview, verify that **Supported account types** is set to **My organization only**.
139
141
140
-
1. To verify that access to your app is limited to users in your organization, got to your web app **Overview** and select the **Default domain** link. Or, start a browser in incognito or private mode and go to `https://<app-name>.azurewebsites.net`.
142
+
1. To verify that access to your app is limited to users in your organization, go to your web app **Overview** and select the **Default domain** link. Or, start a browser in incognito or private mode and go to `https://<app-name>.azurewebsites.net`.
141
143
142
144
:::image type="content" alt-text="Screenshot that shows verifying access." source="../../media/scenario-secure-app-authentication-app-service/verify-access.png":::
Copy file name to clipboardExpand all lines: articles/app-service/overview-authentication-authorization.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Authentication and authorization
3
3
description: Find out about the built-in authentication and authorization support in Azure App Service and Azure Functions, and how it can help secure your app against unauthorized access.
@@ -21,7 +21,7 @@ Implementing a secure solution for authentication (signing-in users) and authori
21
21
22
22
- Azure App Service allows you to integrate a variety of auth capabilities into your web app or API without implementing them yourself.
23
23
- It’s built directly into the platform and doesn’t require any particular language, SDK, security expertise, or even any code to utilize.
24
-
- You can integrate with multiple login providers. For example, Microsoft Entra ID, Facebook, Google, Twitter.
24
+
- You can integrate with multiple login providers. For example, Microsoft Entra, Facebook, Google, Twitter.
25
25
26
26
Your app might need to support more complex scenarios such as Visual Studio integration or incremental consent. There are several different authentication solutions available to support these scenarios. To learn more, read [Identity scenarios](identity-scenarios.md).
27
27
@@ -45,7 +45,7 @@ When you configure this feature with one of these providers, its sign-in endpoin
45
45
46
46
Enabling this feature will cause all requests to your application to be automatically redirected to HTTPS, regardless of the App Service configuration setting to enforce HTTPS. You can disable this with the `requireHttps` setting in the V2 configuration. However, we do recommend sticking with HTTPS, and you should ensure no security tokens ever get transmitted over non-secure HTTP connections.
47
47
48
-
App Service can be used for authentication with or without restricting access to your site content and APIs. To restrict app access only to authenticated users, set **Action to take when request is not authenticated** to log in with one of the configured identity providers. To authenticate but not restrict access, set **Action to take when request is not authenticated** to "Allow anonymous requests (no action)."
48
+
App Service can be used for authentication with or without restricting access to your site content and APIs. Access restrictions can be set in the **Authentication** > **Authentication settings** section of your web app. To restrict app access only to authenticated users, set **Action to take when request is not authenticated** to log in with one of the configured identity providers. To authenticate but not restrict access, set **Action to take when request is not authenticated** to "Allow anonymous requests (no action)."
49
49
50
50
> [!IMPORTANT]
51
51
> You should give each app registration its own permission and consent. Avoid permission sharing between environments by using separate app registrations for separate deployment slots. When testing new code, this practice can help prevent issues from affecting the production app.
@@ -114,23 +114,29 @@ For client browsers, App Service can automatically direct all unauthenticated us
114
114
115
115
In the [Azure portal](https://portal.azure.com), you can configure App Service with a number of behaviors when incoming request is not authenticated. The following headings describe the options.
116
116
117
-
**Allow unauthenticated requests**
117
+
**Restric access**
118
118
119
-
This option defers authorization of unauthenticated traffic to your application code. For authenticated requests, App Service also passes along authentication information in the HTTP headers.
119
+
-**Allow unauthenticated requests**This option defers authorization of unauthenticated traffic to your application code. For authenticated requests, App Service also passes along authentication information in the HTTP headers.
120
120
121
-
This option provides more flexibility in handling anonymous requests. For example, it lets you [present multiple sign-in providers](configure-authentication-customize-sign-in-out.md#use-multiple-sign-in-providers) to your users. However, you must write code.
121
+
This option provides more flexibility in handling anonymous requests. For example, it lets you [present multiple sign-in providers](configure-authentication-customize-sign-in-out.md#use-multiple-sign-in-providers) to your users. However, you must write code.
122
122
123
-
**Require authentication**
123
+
-**Require authentication** This option will reject any unauthenticated traffic to your application. Specific action to take is specified in the **Unauthenticated requests** section.
124
124
125
-
This option will reject any unauthenticated traffic to your application. This rejection can be a redirect action to one of the configured identity providers. In these cases, a browser client is redirected to `/.auth/login/<provider>` for the provider you choose. If the anonymous request comes from a native mobile app, the returned response is an `HTTP 401 Unauthorized`. You can also configure the rejection to be an `HTTP 401 Unauthorized` or `HTTP 403 Forbidden` for all requests.
125
+
With this option, you don't need to write any authentication code in your app. Finer authorization, such as role-specific authorization, can be handled by inspecting the user's claims (see [Access user claims](configure-authentication-user-identities.md)).
126
126
127
-
With this option, you don't need to write any authentication code in your app. Finer authorization, such as role-specific authorization, can be handled by inspecting the user's claims (see [Access user claims](configure-authentication-user-identities.md)).
127
+
> [!CAUTION]
128
+
> Restricting access in this way applies to all calls to your app, which may not be desirable for apps wanting a publicly available home page, as in many single-page applications.
128
129
129
-
> [!CAUTION]
130
-
> Restricting access in this way applies to all calls to your app, which may not be desirable for apps wanting a publicly available home page, as in many single-page applications.
130
+
> [!NOTE]
131
+
> When using the Microsoft identity provider for users in your organization, the default behavior is that any user in your Microsoft Entra tenant can request a token for your application. You can [configure the application in Microsoft Entra](../active-directory/develop/howto-restrict-your-app-to-a-set-of-users.md) if you want to restrict access to your app to a defined set of users. App Service also offers some [basic built-in authorization checks](.\configure-authentication-provider-aad.md#authorize-requests) which can help with some validations. To learn more about authorization in Microsoft Entra, see [Microsoft Entra authorization basics](../active-directory/develop/authorization-basics.md).
132
+
133
+
**Unauthenticated requests**
134
+
135
+
-**HTTP 302 Found redirect: recommended for websites** Redirects action to one of the configured identity providers. In these cases, a browser client is redirected to `/.auth/login/<provider>` for the provider you choose.
136
+
-**HTTP 401 Unauthorized: recommended for APIs** If the anonymous request comes from a native mobile app, the returned response is an `HTTP 401 Unauthorized`. You can also configure the rejection to be an `HTTP 401 Unauthorized` for all requests.
137
+
-**HTTP 403 Forbidden** Configures the rejection to be an `HTTP 403 Forbidden` for all requests.
138
+
-**HTTP 404 Not found** Configures the rejection to be an `HTTP 404 Not found` for all requests.
131
139
132
-
> [!NOTE]
133
-
> When using the Microsoft identity provider for users in your organization, the default behavior is that any user in your Microsoft Entra tenant can request a token for your application. You can [configure the application in Microsoft Entra ID](../active-directory/develop/howto-restrict-your-app-to-a-set-of-users.md) if you want to restrict access to your app to a defined set of users. App Service also offers some [basic built-in authorization checks](.\configure-authentication-provider-aad.md#authorize-requests) which can help with some validations. To learn more about authorization in the Microsoft identity platform, see [Microsoft identity platform authorization basics](../active-directory/develop/authorization-basics.md).
0 commit comments