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
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,27 @@ Your apps are now configured. The frontend is now ready to access the backend wi
249
249
250
250
For information on how to configure the access token for other providers, see [Refresh identity provider tokens](configure-authentication-oauth-tokens.md#refresh-auth-tokens).
251
251
252
-
## 6. Frontend calls the authenticated backend
252
+
## 6. Configure backend App Service to accept a token only from the frontend App Service
253
+
254
+
You should also configure the backend App Service to only accept a token from the frontend App Service. Not doing this may result in a "403: Forbidden error" when you pass the token from the frontend to the backend.
255
+
256
+
You can set this via the same Azure CLI process you used in the previous step.
257
+
258
+
1. Get the `appId` of the frontend App Service (you can get this on the "Authentication" blade of the frontend App Service).
259
+
260
+
1. Run the following Azure CLI, substituting the `<back-end-app-name>` and `<front-end-app-id>`.
261
+
262
+
```azurecli-interactive
263
+
authSettings=$(az webapp auth show -g myAuthResourceGroup -n <back-end-app-name>)
az webapp auth set --resource-group myAuthResourceGroup --name <back-end-app-name> --body "$authSettings"
270
+
```
271
+
272
+
## 7. Frontend calls the authenticated backend
253
273
254
274
The frontend app needs to pass the user's authentication with the correct `user_impersonation` scope to the backend. The following steps review the code provided in the sample for this functionality.
0 commit comments