Skip to content

Commit 8e24975

Browse files
committed
fix typo
1 parent 7e0cfbe commit 8e24975

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

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
@@ -12,30 +12,30 @@ This article explains how to configure bundled consent for Microsoft Entra ID ap
1212

1313
## Symptoms
1414

15-
You have a custom client app and a custom API app and you create app registrations for the both apps in Microsoft Entra ID. You configure bundle the 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 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:
1616

17-
- 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
17+
- 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

19-
- AADSTS650052: The app is trying to access a service\”{app_id}\”(\”app_name\”) that your organization %\”{organization}\” lacks a service principal for. Contact your IT Admin to review the configuration of your service subscriptions or consent to the application in order to create the required service principal
19+
- AADSTS650052: The app is trying to access a service\”{app_id}\”(\”app_name\”) that your organization %\”{organization}\” lacks a service principal for. Contact your IT Admin to review the configuration of your service subscriptions or consent to the application in order to create the required service principal.
2020

2121
## Solution
2222

23-
## Step 1: Configure knownClientApplications for the API app registration
23+
### Step 1: Configure knownClientApplications for the API app registration
2424

2525
Add the custom client app ID to the custom API app registration's `knownClientApplications` property. For more information, see [knownClientApplications attribute](/entra/identity-platform/reference-app-manifest#knownclientapplications-attribute).
2626

27-
## Step 2: Configure API permissions
27+
### Step 2: Configure API permissions
2828

2929
Make sure that:
3030

3131
- All required API permissions are correctly configured on both the custom client and custom API app registrations.
3232
- The custom client app registration includes the API permissions that are defined in the custom API app registration.
3333

34-
## Step 3: The sign-in request
34+
### Step 3: The sign-in request
3535

36-
Your authentication request must use the `.default` scope for Microsoft Graph. For Microsoft accounts, the scope must be for the custom API.
36+
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
@@ -45,10 +45,11 @@ https://login.microsoftonline.com/common/oauth2/v2.0/authorize
4545
&scope=openid profile offline_access app_uri_id1/.default
4646
&prompt=consent
4747
```
48-
> [NOTE!]
48+
49+
> [!NOTE]
4950
> The client will not appear as having permission for the API. This is expected because the client is listed as a knownClientApplication.
5051
51-
### Example request for Work or school accounts only
52+
**Example request for Work or school accounts only**
5253

5354
If you are not supporting Microsoft Accounts:
5455

@@ -60,12 +61,11 @@ GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize
6061
&redirect_uri=https://localhost
6162
&scope=openid profile offline_access User.Read https://graph.microsoft.com/.default
6263
&prompt=consent
63-
6464
```
6565

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

68-
```http
68+
```csharp
6969
String[] consentScope = { "api://ae5a0bbe-d6b3-4a20-867b-c8d9fd442160/.default" };
7070
var loginResult = await clientApp.AcquireTokenInteractive(consentScope)
7171
.WithAccount(account)
@@ -75,7 +75,7 @@ var loginResult = await clientApp.AcquireTokenInteractive(consentScope)
7575

7676
Consent propagation for new service principals and permissions may take time. Your application should handle this delay.
7777

78-
### Acquire Tokens for multiple resources
78+
#### Acquire tokens for multiple resources
7979

8080
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:
8181

@@ -85,7 +85,7 @@ If your client app needs to acquire tokens for another resource such as Microsof
8585

8686
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.
8787

88-
Here is a sample code about retry logic:
88+
Here is a sample code about the retry logic:
8989

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

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

153153
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:
154154

@@ -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 throw an error and instruct the client to initial a full consent process.
177+
If all retries fail, return an error and instruct the client to initial a full consent process.
178178

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

@@ -199,7 +199,7 @@ if(apiResult.StatusCode==HttpStatusCode.Forbidden)
199199

200200
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.
201201

202-
If you dont separate this flow and instead combine it with your apps 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:
202+
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.
205205
- For work or school accounts, typically only one consent prompt is required.

0 commit comments

Comments
 (0)