Skip to content

Commit 269bc39

Browse files
authored
Merge pull request #179145 from cephalin/issue#83353
https://github.com/MicrosoftDocs/azure-docs/issues/83353
2 parents eed35fd + bb2f43e commit 269bc39

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

articles/app-service/tutorial-auth-aad.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,15 @@ Now that you've enabled authentication and authorization to both of your apps, e
294294
295295
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).
296296

297-
In the Cloud Shell, run the following command 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>*.
297+
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>*.
298298

299299
```azurecli-interactive
300-
az webapp auth set --resource-group myAuthResourceGroup --name <front-end-app-name> --body '{"identityProviders":{"azureActiveDirectory":{"login":{"loginParameters":["scope=openid profile email offline_access api://<back-end-client-id>/user_impersonation"]}}}}'
300+
authSettings=$(az webapp auth show -g myAuthResourceGroup -n <front-end-app-name>)
301+
authSettings=$(echo "$authSettings” | jq '.properties' | jq '.identityProviders.azureActiveDirectory.login += {"loginParameters":["scope=openid profile email offline_access api://<back-end-client-id>/user_impersonation"]}')
302+
az webapp auth set --resource-group myAuthResourceGroup --name <front-end-app-name> --body "$authSettings"
301303
```
302304
303-
Here's an explanation of the requested scopes:
305+
The commands effectively adds a `loginParameters` property with additional custom scopes. Here's an explanation of the requested scopes:
304306
305307
- `openid`, `profile`, and `email` are requested by App Service by default already. For information, see [OpenID Connect Scopes](../active-directory/develop/v2-permissions-and-consent.md#openid-connect-scopes).
306308
- `api://<back-end-client-id>/user_impersonation` is an exposed API in your back-end app registration. It's the scope that gives you a JWT token that includes the back end app as a [token audience](https://wikipedia.org/wiki/JSON_Web_Token).

0 commit comments

Comments
 (0)