Skip to content

Commit 4927556

Browse files
authored
Update bundle-consent-application-registrations.md
Edit review per CI 5825
1 parent 7a1fbba commit 4927556

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

support/entra/entra-id/app-integration/bundle-consent-application-registrations.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ ms.custom: sap:Developing or Registering apps with Microsoft identity platform
88
---
99
# Bundle consent for Microsoft Entra ID applications
1010

11-
This article explains how to configure bundled consent for Microsoft Entra ID applications.
11+
This article discusses how to configure bundled consent for Microsoft Entra ID applications.
1212

1313
## Symptoms
1414

15-
You have a custom client app and a custom API app, and you create app registrations for both apps in Microsoft Entra ID. You configure bundle consent for these two apps. In this scenario, you might receive one of the following errors when you try to sign into the app:
15+
You have a custom client app and a custom API app, and you create app registrations for both apps in Microsoft Entra ID. You configure bundled consent for both apps. In this scenario, you might receive one of the following error messages when you try to sign in to either app:
1616

1717
- AADSTS70000: The request was denied because one or more scopes requested are unauthorized or expired. The user must first sign in and grant the client application access to the requested scope.
1818

@@ -35,7 +35,7 @@ Make sure that:
3535

3636
Your authentication request must use the `.default` scope for Microsoft Graph. For Microsoft accounts, the scope must be for the custom API.
3737

38-
**Example Request for Microsoft accounts and Work or school accounts**
38+
**Example Request for Microsoft accounts and work or school accounts**
3939

4040
```HTTP
4141
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
@@ -47,11 +47,11 @@ https://login.microsoftonline.com/common/oauth2/v2.0/authorize
4747
```
4848

4949
> [!NOTE]
50-
> The client will not appear as having permission for the API. This is expected because the client is listed as a knownClientApplication.
50+
> The client will seem to be lacking permission for the API. This is expected because the client is listed as `knownClientApplication`.
5151
52-
**Example request for Work or school accounts only**
52+
**Example request for work or school accounts only**
5353

54-
If you are not supporting Microsoft Accounts:
54+
If you're not supporting Microsoft Accounts:
5555

5656
```http
5757
@@ -63,7 +63,7 @@ GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize
6363
&prompt=consent
6464
```
6565

66-
#### Implementation with MSAL.NET
66+
#### Implementation by using MSAL.NET
6767

6868
```csharp
6969
String[] consentScope = { "api://ae5a0bbe-d6b3-4a20-867b-c8d9fd442160/.default" };
@@ -73,19 +73,19 @@ var loginResult = await clientApp.AcquireTokenInteractive(consentScope)
7373
.ExecuteAsync();
7474
```
7575

76-
Consent propagation for new service principals and permissions may take time. Your application should handle this delay.
76+
Consent propagation for new service principals and permissions can take some time to finish. Your application should successfully handle this delay.
7777

7878
#### Acquire tokens for multiple resources
7979

80-
If your client app needs to acquire tokens for another resource such as Microsoft Graph, you must implement logic to handle potential delays after users consent to application. Here are some recommendations:
80+
If your client app has to acquire tokens for another resource, such as Microsoft Graph, you must implement logic to handle potential delays after users consent to the application. Here are some recommendations:
8181

82-
- Use the `.default` scope when requesting tokens.
82+
- Use the `.default` scope when you request tokens.
8383
- Track acquired scopes until the required one is returned.
8484
- Add a delay if the result still does not have the required scope.
8585

86-
Currently, if `AcquireTokenSilent` fails, MSAL requires a successful interactive authentication before allowing another silent token acquisition. This restriction applies even if a valid refresh token is available.
86+
Currently, if `AcquireTokenSilent` fails, MSAL requires a successful interactive authentication before it allows another silent token acquisition. This restriction applies even if a valid refresh token is available.
8787

88-
Here is a sample code about the retry logic:
88+
Here's some sample code that uses retry logic:
8989

9090
```csharp
9191
public static async Task<AuthenticationResult> GetTokenAfterConsentAsync(string[] resourceScopes)
@@ -148,9 +148,9 @@ Here is a sample code about the retry logic:
148148
}
149149
```
150150

151-
#### On the custom API using the On-behalf-of flow
151+
#### About the custom API that uses the On-behalf-of flow
152152

153-
Similar to the client app, when your custom API tries to acquire tokens for another resource using the On-Behalf-Of (OBO) flow, it may fail immediately after consent. To resolve this issue, you can implement retry logic and scope tracking as the following sample:
153+
Similar to the client app, when your custom API tries to acquire tokens for another resource by using the On-Behalf-Of (OBO) flow, it might fail immediately after consent. To resolve this issue, you can implement retry logic and scope tracking, as in the following sample code:
154154

155155
```csharp
156156
while (result == null && retryCount >= 6)
@@ -174,7 +174,7 @@ while (result == null && retryCount >= 6)
174174
If (result==null) return new HttpStatusCodeResult(HttpStatusCode.Forbidden, "Need Consent");
175175
```
176176

177-
If all retries fail, return an error and instruct the client to initial a full consent process.
177+
If all retries fail, return an error message, and then instruct the client to initial a full consent process.
178178

179179
**Example of client code that assumes your API throws a 403**
180180

@@ -197,12 +197,12 @@ if(apiResult.StatusCode==HttpStatusCode.Forbidden)
197197

198198
## Recommendations and expected behavior
199199

200-
Ideally, you should create a separate flow that guides users through the consent process, provisions your app and API in their tenant or Microsoft account, and completes consent in a single step that separate from signing in.
200+
Ideally, you would create a separate flow that guides users through the consent process, provisions your app and API in their tenant or Microsoft account, and completes consent in a single step that's separate from signing in.
201201

202202
If you don't separate this flow and instead combine it with your app's sign-in experience, the process can become confusing. Users may encounter multiple consent prompts. To improve the experience, consider adding a message in your app that informs users they might be asked to consent more than once:
203203

204204
- For Microsoft accounts, expect at least two consent prompts: one for the client app and one for the API.
205-
- For work or school accounts, typically only one consent prompt is required.
205+
- Typically, for work or school accounts, only one consent prompt is required.
206206

207207
The following is an end-to-end code sample that demonstrates a smooth user experience. It supports all account types and prompts for consent only when necessary.
208208

@@ -276,4 +276,4 @@ if(apiResult.StatusCode==HttpStatusCode.Forbidden)
276276
}
277277
```
278278

279-
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
279+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)