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/tutorial-auth-aad.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,26 +208,26 @@ Now that you've enabled authentication and authorization to both of your apps, e
208
208
> [!TIP]
209
209
> If you run into errors and reconfigure your app's authentication/authorization settings, the tokens in the token store may not be regenerated from the new settings. To make sure your tokens are regenerated, you need to sign out and sign back in to your app. An easy way to do it is to use your browser in private mode, and close and reopen the browser in private mode after changing the settings in your apps.
210
210
211
-
In this step, you **grant the front-end app access to the backend app** on the user's behalf. (Technically, you give the front end's _AD application_ the permissions to access the back end's _AD application_ on the user's behalf.)
211
+
In this step, you **grant the frontend app access to the backend app** on the user's behalf. (Technically, you give the front end's _AD application_ the permissions to access the back end's _AD application_ on the user's behalf.)
212
212
213
-
1. In the **Authentication** page for the front-end app, select your front-end app name under **Identity provider**. This app registration was automatically generated for you. Select **API permissions** in the left menu.
213
+
1. In the **Authentication** page for the frontend app, select your frontend app name under **Identity provider**. This app registration was automatically generated for you. Select **API permissions** in the left menu.
214
214
215
-
1. Select **Add a permission**, then select **My APIs** > **\<back-end-app-name>**.
215
+
1. Select **Add a permission**, then select **My APIs** > **\backend-<ABC>**.
216
216
217
217
1. In the **Request API permissions** page for the back-end app, select **Delegated permissions** and **user_impersonation**, then select **Add permissions**.
218
218
219
219
:::image type="content" source="./media/tutorial-auth-aad/select-permission-front-end.png" alt-text="Screenshot of the Request API permissions page showing Delegated permissions, user_impersonation, and the Add permission button selected.":::
220
220
221
221
### Configure App Service to return a usable access token
222
222
223
-
The front-end app now has the required permissions to access the back-end app as the signed-in user. In this step, you configure App Service authentication and authorization to give you a usable access token for accessing the back end. For this step, you need the back end's client ID, which you copied from [Enable authentication and authorization for back-end app](#enable-authentication-and-authorization-for-back-end-app).
223
+
The frontend app now has the required permissions to access the back-end app as the signed-in user. In this step, you configure App Service authentication and authorization to give you a usable access token for accessing the back end. For this step, you need the back end's client ID, which you copied from [Enable authentication and authorization for back-end app](#enable-authentication-and-authorization-for-back-end-app).
224
224
225
-
In the Cloud Shell, run the following commands on the front-end app to add the `scope` parameter to the authentication setting `identityProviders.azureActiveDirectory.login.loginParameters`. Replace *\<front-end-app-name>* and *\<back-end-client-id>*.
225
+
In the Cloud Shell, run the following commands on the frontend app to add the `scope` parameter to the authentication setting `identityProviders.azureActiveDirectory.login.loginParameters`. Replace *\frontend-<ABC>* and *\<back-end-client-id>*.
226
226
227
227
```azurecli-interactive
228
-
authSettings=$(az webapp auth show -g myAuthResourceGroup -n <front-end-app-name>)
228
+
authSettings=$(az webapp auth show -g myAuthResourceGroup -n frontend-<ABC>)
az webapp auth set --resource-group myAuthResourceGroup --name <front-end-app-name> --body "$authSettings"
230
+
az webapp auth set --resource-group myAuthResourceGroup --name frontend-<ABC> --body "$authSettings"
231
231
```
232
232
233
233
The commands effectively add a `loginParameters` property with additional custom scopes. Here's an explanation of the requested scopes:
@@ -239,7 +239,7 @@ The commands effectively add a `loginParameters` property with additional custom
239
239
> [!TIP]
240
240
> - To view the `api://<back-end-client-id>/user_impersonation` scope in the Azure portal, go to the **Authentication** page for the back-end app, click the link under **Identity provider**, then click **Expose an API** in the left menu.
241
241
> - To configure the required scopes using a web interface instead, see the Microsoft steps at [Refresh auth tokens](configure-authentication-oauth-tokens.md#refresh-auth-tokens).
242
-
> - Some scopes require admin or user consent. This requirement causes the consent request page to be displayed when a user signs into the front-end app in the browser. To avoid this consent page, add the front end's app registration as an authorized client application in the **Expose an API** page by clicking **Add a client application** and supplying the client ID of the front end's app registration.
242
+
> - Some scopes require admin or user consent. This requirement causes the consent request page to be displayed when a user signs into the frontend app in the browser. To avoid this consent page, add the front end's app registration as an authorized client application in the **Expose an API** page by clicking **Add a client application** and supplying the client ID of the front end's app registration.
243
243
244
244
::: zone pivot="platform-linux"
245
245
@@ -309,7 +309,7 @@ if (bearerToken) {
309
309
310
310
## Browse to the apps
311
311
312
-
1. Use the frontend web site in a browser. TheURL is in the formate of`https://<FRONTEND-APP-NAME>.azurewebsites.net/`.
312
+
1. Use the frontend web site in a browser. TheURL is in the formate of`https://frontend-<ABC>.azurewebsites.net/`.
313
313
1. The browser requests your authentication to the web app. Complete the authentication.
314
314
1. After authentication completes, the frontend application returns the home page of the app.
315
315
@@ -337,7 +337,7 @@ The authentication in this procedure is provided at the hosting platform layer b
337
337
The frontend and backend apps both have `/debug` routes to help debug the authentication when this application doesn't return the _fake_ profile. The frontend debug route provides the critical pieces to validate:
338
338
339
339
* Environment variables:
340
-
* The `BACKEND_URL` is configured correctly as `https://<YOUR-BACKEND_APP_NAME>..azurewebsites.net`. Don't include that trailing forward slash or the route.
340
+
* The `BACKEND_URL` is configured correctly as `https://backend-<ABC>.azurewebsites.net`. Don't include that trailing forward slash or the route.
341
341
*HTTP headers:
342
342
* The `x-ms-token-*` headers are injected.
343
343
* Microsoft Graph profile name for signed in user is displayed.
0 commit comments