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: 2-WebApp-graph-user/2-3-Multi-Tenant/README.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,8 +232,6 @@ These steps are encapsulated in the [Microsoft.Identity.Web](https://github.com/
232
232
233
233
In order to be able to sign-in users from multiple tenants, the [/common endpoint](https://docs.microsoft.com/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant#update-your-code-to-send-requests-to-common) must be used. In the sample, this endpoint is used as a result of setting the value for `TenantId` as `organizations` on the `appsettings.json` file, and configuring the middleware to read the values from it.
234
234
235
-
NOTE: Guest users in a tenant will not be authenticated if the `https://login.microsoftonline.com/common/` endpoint is used as the authority to sign in users. `TenantId` will be required for those users.
Copy file name to clipboardExpand all lines: 4-WebApp-your-API/4-3-AnyOrg/Readme.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,7 +146,7 @@ As a first step you'll need to:
146
146
1. Select **New registration**.
147
147
1. In the **Register an application page** that appears, enter your application's registration information:
148
148
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApi-MultiTenant-v2`.
149
-
- Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
149
+
- Under **Supported account types**, select **Accounts in any organizational directory**.
150
150
- In the **Redirect URI** section, select **Web** in the combo-box and enter the following redirect URI: `https://localhost:44351/api/Home`.
151
151
1. Select **Register** to create the application.
152
152
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.
@@ -195,7 +195,7 @@ Open the project in your IDE (like Visual Studio) to configure the code.
195
195
1. Select **New registration**.
196
196
1. In the **Register an application page** that appears, enter your application's registration information:
197
197
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `WebApp-MultiTenant-v2`.
198
-
- Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
198
+
- Under **Supported account types**, select **Accounts in any organizational directory**.
199
199
- In the **Redirect URI (optional)** section, select **Web** in the combo-box and enter the following redirect URI: `https://localhost:44321/`.
200
200
> 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.
201
201
1. Select **Register** to create the application.
@@ -205,9 +205,6 @@ Open the project in your IDE (like Visual Studio) to configure the code.
205
205
- In the **Redirect URIs** section, enter the following redirect URIs.
206
206
-`https://localhost:44321/signin-oidc`
207
207
- In the **Logout URL** section, set it to `https://localhost:44321/signout-oidc`.
208
-
- In the **Implicit grant** section, check **ID tokens** as this sample requires
209
-
the [Implicit grant flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow) to be enabled to
210
-
sign-in the user, and call an API.
211
208
1. Select **Save** to save your changes.
212
209
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.
213
210
1. In the **Client secrets** section, click on **New client secret**:
@@ -219,7 +216,7 @@ Open the project in your IDE (like Visual Studio) to configure the code.
219
216
- Click the **Add a permission** button and then,
220
217
- Ensure that the **My APIs** tab is selected.
221
218
- In the list of APIs, select the API `WebApi-MultiTenant-v2`.
222
-
- In the **Delegated permissions** section, select the **access_as_user** in the list. Use the search box if necessary.
219
+
- In the **Delegated permissions** section, select the **Access 'WebApi-MultiTenant-v2'** in the list. Use the search box if necessary.
223
220
- Click on the **Add permissions** button at the bottom.
224
221
225
222
##### Configure the Web App (WebApp-MultiTenant-v2) to use your app registration
@@ -258,7 +255,7 @@ This behavior is expected as the browser is not authenticated. The Web applicati
258
255
##### Step 1. Install .NET Core dependencies
259
256
260
257
```console
261
-
cd TodoListAPI
258
+
cd TodoListService
262
259
dotnet restore
263
260
```
264
261
@@ -351,15 +348,15 @@ Once it finishes, your applications service principal will be provisioned in tha
351
348
352
349
### Provisioning your Multi-tenant Apps in another Azure AD Tenant
353
350
354
-
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.
351
+
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.
355
352
356
-
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**.
353
+
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**.
357
354
358
355
### Code for the Web App (TodoListClient)
359
356
360
357
####
361
358
362
-
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.
359
+
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.
@@ -469,7 +466,7 @@ public IActionResult AdminConsent()
469
466
470
467
#### Choosing which scopes to expose
471
468
472
-
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:
469
+
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