Skip to content

Commit d45d76a

Browse files
committed
Readme and Launch Settings Update
1 parent caaa5de commit d45d76a

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

4-WebApp-your-API/4-3-AnyOrg/Readme.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ As a first step you'll need to:
136136
1. Select **New registration**.
137137
1. In the **Register an application page** that appears, enter your application's registration information:
138138
- 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`.
141141
1. Select **Register** to create the application.
142142
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.
143143
1. Select **Save** to save your changes.
@@ -185,7 +185,7 @@ Open the project in your IDE (like Visual Studio) to configure the code.
185185
1. Select **New registration**.
186186
1. In the **Register an application page** that appears, enter your application's registration information:
187187
- 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**.
189189
- In the **Redirect URI (optional)** section, select **Web** in the combo-box and enter the following redirect URI: `https://localhost:44321/`.
190190
> 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.
191191
1. Select **Register** to create the application.
@@ -195,9 +195,6 @@ Open the project in your IDE (like Visual Studio) to configure the code.
195195
- In the **Redirect URIs** section, enter the following redirect URIs.
196196
- `https://localhost:44321/signin-oidc`
197197
- 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.
201198
1. Select **Save** to save your changes.
202199
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.
203200
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.
209206
- Click the **Add a permission** button and then,
210207
- Ensure that the **My APIs** tab is selected.
211208
- 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.
213210
- Click on the **Add permissions** button at the bottom.
214211

215212
##### 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
247244
##### Step 1. Install .NET Core dependencies
248245

249246
```console
250-
cd TodoListAPI
247+
cd TodoListService
251248
dotnet restore
252249
```
253250
Then:
@@ -338,15 +335,15 @@ Once it finishes, your applications service principal will be provisioned in tha
338335

339336
### Provisioning your Multi-tenant Apps in another Azure AD Tenant
340337

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.
342339

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**.
344341

345342
### Code for the Web App (TodoListClient)
346343

347344
####
348345

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.
350347
```csharp
351348
services.AddMicrosoftWebAppAuthentication(Configuration)
352349
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { Configuration["TodoList:TodoListScope"] })
@@ -456,7 +453,7 @@ public IActionResult AdminConsent()
456453

457454
#### Choosing which scopes to expose
458455

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:
460457

461458
```csharp
462459
HttpContext.VerifyUserHasAnyAcceptedScope(scopeRequiredByApi);

4-WebApp-your-API/4-3-AnyOrg/TodoListService/Properties/launchSettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"environmentVariables": {
2424
"ASPNETCORE_ENVIRONMENT": "Development"
2525
},
26-
"applicationUrl": "http://localhost:1040/"
26+
"applicationUrl": "https://localhost:44351/",
27+
"sslPort": 44351
2728
}
2829
}
2930
}

0 commit comments

Comments
 (0)