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: 4-WebApp-your-API/4-3-AnyOrg/Readme.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,8 +136,8 @@ As a first step you'll need to:
136
136
1. Select **New registration**.
137
137
1. In the **Register an application page** that appears, enter your application's registration information:
138
138
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApi-MultiTenant-v2`.
139
-
- Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
140
-
- In the **Redirect URI** section, select **Web** in the combo-box and enter the following redirect URI: `https://localhost:44351/api/Home`.
139
+
- Under **Supported account types**, select **Accounts in any organizational directory**.
140
+
- In the **Redirect URI** section, select **Web** in the combo-box and enter the following redirect URI: `https://localhost:44351/api/Home`.
141
141
1. Select **Register** to create the application.
142
142
1. In the app's registration screen, find and note the **Application (client) ID**. You use this value in your app's configuration file(s) later in your code.
143
143
1. Select **Save** to save your changes.
@@ -185,7 +185,7 @@ Open the project in your IDE (like Visual Studio) to configure the code.
185
185
1. Select **New registration**.
186
186
1. In the **Register an application page** that appears, enter your application's registration information:
187
187
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApp-MultiTenant-v2`.
188
-
- Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
188
+
- Under **Supported account types**, select **Accounts in any organizational directory**.
189
189
- In the **Redirect URI (optional)** section, select **Web** in the combo-box and enter the following redirect URI: `https://localhost:44321/`.
190
190
> Note that there are more than one redirect URIs used in this sample. You'll need to add them from the **Authentication** tab later after the app has been created successfully.
191
191
1. Select **Register** to create the application.
@@ -195,9 +195,6 @@ Open the project in your IDE (like Visual Studio) to configure the code.
195
195
- In the **Redirect URIs** section, enter the following redirect URIs.
196
196
-`https://localhost:44321/signin-oidc`
197
197
- In the **Logout URL** section, set it to `https://localhost:44321/signout-oidc`.
198
-
- In the **Implicit grant** section, check **ID tokens** as this sample requires
199
-
the [Implicit grant flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow) to be enabled to
200
-
sign-in the user, and call an API.
201
198
1. Select **Save** to save your changes.
202
199
1. In the app's registration screen, click on the **Certificates & secrets** blade in the left to open the page where we can generate secrets and upload certificates.
203
200
1. In the **Client secrets** section, click on **New client secret**:
@@ -209,7 +206,7 @@ Open the project in your IDE (like Visual Studio) to configure the code.
209
206
- Click the **Add a permission** button and then,
210
207
- Ensure that the **My APIs** tab is selected.
211
208
- In the list of APIs, select the API `WebApi-MultiTenant-v2`.
212
-
- In the **Delegated permissions** section, select the **access_as_user** in the list. Use the search box if necessary.
209
+
- In the **Delegated permissions** section, select the **Access 'WebApi-MultiTenant-v2'** in the list. Use the search box if necessary.
213
210
- Click on the **Add permissions** button at the bottom.
214
211
215
212
##### Configure the Web App (WebApp-MultiTenant-v2) to use your app registration
@@ -247,7 +244,7 @@ This behavior is expected as the browser is not authenticated. The Web applicati
247
244
##### Step 1. Install .NET Core dependencies
248
245
249
246
```console
250
-
cd TodoListAPI
247
+
cd TodoListService
251
248
dotnet restore
252
249
```
253
250
Then:
@@ -338,15 +335,15 @@ Once it finishes, your applications service principal will be provisioned in tha
338
335
339
336
### Provisioning your Multi-tenant Apps in another Azure AD Tenant
340
337
341
-
Often the user-based consent will be disabled in an Azure AD tenant or your application will be requesting permissions that requires a tenant-admin consent. In these scenarios, your application will need to utilize the `/adminconsent` endpoint to provision both the **ToDoListClient** and the **TodoListAPI** before the users from that tenant are able to sign-in to your app.
338
+
Often the user-based consent will be disabled in an Azure AD tenant or your application will be requesting permissions that requires a tenant-admin consent. In these scenarios, your application will need to utilize the `/adminconsent` endpoint to provision both the **ToDoListClient** and the **TodoListService** before the users from that tenant are able to sign-in to your app.
342
339
343
-
When provisioning, you have to take care of the dependency in the topology where the **ToDoListClient** is dependent on **TodoListAPI**. So in such a case, you would provision the **TodoListAPI** before the **ToDoListClient**.
340
+
When provisioning, you have to take care of the dependency in the topology where the **ToDoListClient** is dependent on **TodoListService**. So in such a case, you would provision the **TodoListService** before the **ToDoListClient**.
344
341
345
342
### Code for the Web App (TodoListClient)
346
343
347
344
####
348
345
349
-
In `Startup.cs`, below lines of code enables Microsoft identity platform endpoint. This endpoint is capable of signing-in users both with their Work and School and Microsoft Personal accounts.
346
+
In `Startup.cs`, below lines of code enables Microsoft identity platform endpoint. This endpoint is capable of signing-in users both with their Work and School.
@@ -456,7 +453,7 @@ public IActionResult AdminConsent()
456
453
457
454
#### Choosing which scopes to expose
458
455
459
-
This sample exposes a delegated permission (access_as_user) that will be presented in the access token claim. The method `AddProtectedWebApi` does not validate the scope, but Microsoft.Identity.Web has a HttpContext extension method, `VerifyUserHasAnyAcceptedScope`, where you can validate the scope as below:
456
+
This sample exposes a delegated permission (access_as_user) that will be presented in the access token claim. The method `AddMicrosoftWebApi` does not validate the scope, but Microsoft.Identity.Web has a HttpContext extension method, `VerifyUserHasAnyAcceptedScope`, where you can validate the scope as below:
0 commit comments