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/container-apps/authentication.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,11 @@ For details surrounding authentication and authorization, refer to the following
24
24
25
25
## Why use the built-in authentication?
26
26
27
-
You're not required to use this feature for authentication and authorization. You can use the bundled security features in your web framework of choice, or you can write your own utilities. However, implementing a secure solution for authentication (signing-in users) and authorization (providing access to secure data) can take significant effort. You must make sure to follow industry best practices and standards, and keep your implementation up to date.
27
+
You're not required to use this feature for authentication and authorization. You can use the bundled security features in your web framework of choice, or you can write your own utilities. However, implementing a secure solution for authentication (signing-in users) and authorization (providing access to secure data) can take significant effort. You must make sure to follow industry best practices and standards and keep your implementation up to date.
28
28
29
-
The built-in authentication feature for Container Apps can save you time and effort by providing out-of-the-box authentication with federated identity providers, allowing you to focus on the rest of your application.
29
+
With the built-in authentication feature for Container Apps, you can save you time and effort by providing out-of-the-box authentication with federated identity providers, allowing you to focus on the rest of your application.
30
+
31
+
The benefits include:
30
32
31
33
* Azure Container Apps provides access to various built-in authentication providers.
32
34
* The built-in auth features don’t require any particular language, SDK, security expertise, or even any code that you have to write.
@@ -57,17 +59,17 @@ By default, each container app issues its own unique cookie or token for authent
57
59
58
60
## Feature architecture
59
61
60
-
The authentication and authorization middleware component is a feature of the platform that runs as a sidecar container on each replica in your application. When enabled, every incoming HTTP request passes through the security layer before being handled by your application.
62
+
The authentication and authorization middleware component is a feature of the platform that runs as a sidecar container on each replica in your application. When enabled, your application handles each incoming HTTP request after it passes through the security layer.
61
63
62
64
:::image type="content" source="media/authentication/architecture.png" alt-text="An architecture diagram showing requests being intercepted by a sidecar container which interacts with identity providers before allowing traffic to the app container" lightbox="media/authentication/architecture.png":::
63
65
64
66
The platform middleware handles several things for your app:
65
67
66
-
* Authenticates users and clients with the specified identity provider(s)
68
+
* Authenticates users and clients with the specified identity providers
67
69
* Manages the authenticated session
68
70
* Injects identity information into HTTP request headers
69
71
70
-
The authentication and authorization module runs in a separate container, isolated from your application code. As the security container doesn't run in-process, no direct integration with specific language frameworks is possible. However, relevant information your app needs is provided in request headers as explained below.
72
+
The authentication and authorization module runs in a separate container, isolated from your application code. As the security container doesn't run in-process, no direct integration with specific language frameworks is possible. However, relevant information your app needs is provided in request headers as explained in this article.
71
73
72
74
### Authentication flow
73
75
@@ -77,9 +79,9 @@ The authentication flow is the same for all providers, but differs depending on
77
79
78
80
***With provider SDK** (_client-directed flow_ or _client flow_): The application signs users in to the provider manually and then submits the authentication token to Container Apps for validation. This approach is typical for browser-less apps that don't present the provider's sign-in page to the user. An example is a native mobile app that signs users in using the provider's SDK.
79
81
80
-
Calls from a trusted browser app in Container Apps to another REST API in Container Apps can be authenticated using the server-directed flow. For more information, see [Customize sign-ins and sign-outs](#customize-sign-in-and-sign-out).
82
+
Calls from a trusted browser app in Container Apps to another REST API in Container Apps can be authenticated using the server-directed flow. For more information, see [Customize sign in and sign out](#customize-sign-in-and-sign-out).
81
83
82
-
The table below shows the steps of the authentication flow.
84
+
The table shows the steps of the authentication flow.
83
85
84
86
| Step | Without provider SDK | With provider SDK |
85
87
| - | - | - |
@@ -108,9 +110,9 @@ In the [Azure portal](https://portal.azure.com), you can edit your container app
108
110
> [!NOTE]
109
111
> By default, any user in your Microsoft Entra tenant can request a token for your application from Microsoft Entra ID. 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.
110
112
111
-
## Customize sign-in and sign-out
113
+
## Customize sign-in and signout
112
114
113
-
Container Apps Authentication provides built-in endpoints for sign-in and sign-out. When the feature is enabled, these endpoints are available under the `/.auth` route prefix on your container app.
115
+
Container Apps Authentication provides built-in endpoints for signin and signs out. When the feature is enabled, these endpoints are available under the `/.auth` route prefix on your container app.
114
116
115
117
### Use multiple sign-in providers
116
118
@@ -156,7 +158,7 @@ The token format varies slightly according to the provider. See the following ta
156
158
|-|-|-|
157
159
|`aad`|`{"access_token":"<ACCESS_TOKEN>"}`| The `id_token`, `refresh_token`, and `expires_in` properties are optional. |
158
160
|`microsoftaccount`|`{"access_token":"<ACCESS_TOKEN>"}` or `{"authentication_token": "<TOKEN>"`|`authentication_token` is preferred over `access_token`. The `expires_in` property is optional. <br/> When requesting the token from Live services, always request the `wl.basic` scope. |
159
-
|`google`|`{"id_token":"<ID_TOKEN>"}`| The `authorization_code` property is optional. Providing an `authorization_code` value will add an access token and a refresh token to the token store. When specified, `authorization_code` can also optionally be accompanied by a `redirect_uri` property. |
161
+
|`google`|`{"id_token":"<ID_TOKEN>"}`| The `authorization_code` property is optional. Providing an `authorization_code` value adds an access token and a refresh token to the token store. When specified, `authorization_code` can also optionally be accompanied by a `redirect_uri` property. |
160
162
|`facebook`|`{"access_token":"<USER_ACCESS_TOKEN>"}`| Use a valid [user access token](https://developers.facebook.com/docs/facebook-login/access-tokens) from Facebook. |
Users can initiate a sign-out by sending a `GET` request to the app's `/.auth/logout` endpoint. The `GET` request conducts the following actions:
186
+
Users can signout by sending a `GET` request to the app's `/.auth/logout` endpoint. The `GET` request conducts the following actions:
185
187
186
188
* Clears authentication cookies from the current session.
187
189
* Deletes the current user's tokens from the token store.
188
-
*For Microsoft Entra ID and Google, performs a server-side sign-out on the identity provider.
190
+
*Performs a server-side signout on the identity provider for Microsoft Entra ID and Google.
189
191
190
-
Here's a simple sign-out link in a webpage:
192
+
Here's a simple signout link in a webpage:
191
193
192
194
```html
193
195
<ahref="/.auth/logout">Sign out</a>
194
196
```
195
197
196
-
By default, a successful sign-out redirects the client to the URL `/.auth/logout/done`. You can change the post-sign-out redirect page by adding the `post_logout_redirect_uri` query parameter. For example:
198
+
By default, a successful signout redirects the client to the URL `/.auth/logout/done`. You can change the post-sign-out redirect page by adding the `post_logout_redirect_uri` query parameter. For example:
197
199
198
200
```console
199
201
GET /.auth/logout?post_logout_redirect_uri=/index.html
200
202
```
201
203
202
-
It's recommended that you [encode](https://wikipedia.org/wiki/Percent-encoding) the value of `post_logout_redirect_uri`.
204
+
It recommends that you [encode](https://wikipedia.org/wiki/Percent-encoding) the value of `post_logout_redirect_uri`.
203
205
204
206
URL must be hosted in the same domain when using fully qualified URLs.
0 commit comments