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/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,7 +212,7 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
212
212
213
213
### Creating the client web app (TodoListClient)
214
214
215
-
#### Option 2: Create the sample from the command line
215
+
#### Step 1: Create the sample from the command line
216
216
217
217
1. Run the following command to create a sample from the command line using the `SingleOrg` template:
218
218
@@ -224,6 +224,8 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
224
224
225
225
> Note: Replace *`Enter_the_Application_Id_here`* with the *Application Id* from the application Id you just registered in the Application Registration Portal and *`<yourTenantId>`* with the *Directory (tenant) ID* where you created your application.
226
226
227
+
#### Step 2: Modified the generated code
228
+
227
229
1. Open the generated project (.csproj) in Visual Studio, and save the solution.
228
230
1. Add the `Microsoft.Identity.Web.csproj` project which is located at the root of this sample repo, to your solution (**Add Existing Project ...**). It's used to simplify signing-in and, in the next tutorial phases, to get a token.
229
231
1. Add a reference from your newly generated project to `Microsoft.Identity.Web` (right click on the **Dependencies** node under your new project, and choose **Add Reference ...**, and then in the projects tab find the `Microsoft.Identity.Web` project)
@@ -264,7 +266,7 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
264
266
services.AddTodoListService(Configuration);
265
267
```
266
268
267
-
1. Open the `appsettings.json` file and copy the keys from the sample's corresponding file under the `AzureAd` and `TodoList` sections.
269
+
1. Open the `appsettings.json` file and copy the keys from the sample's corresponding file under the `AzureAd` and `TodoList` sections.
268
270
269
271
#### Add a model (TodoListItem) and add the controller and views
270
272
@@ -286,7 +288,7 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
286
288
287
289
The code forthe TodoListService was createdin the following way:
288
290
289
-
#### Create the web api using the ASP.NET Core templates
291
+
#### Step 1: Create the web api using the ASP.NET Core templates
290
292
291
293
```Text
292
294
md TodoListService
@@ -300,7 +302,7 @@ dotnet new webapi -au=SingleOrg
300
302
301
303
In the TodoListService project, add a folder named `Models` and then create a new file named `TodoItem.cs`. Copy the contents of the TodoListService\Models\TodoItem.cs in this file.
302
304
303
-
### Modify the startup.cs file to validate bearer access tokens received by the Web API
305
+
### Modify the Startup.cs file to validate bearer access tokens received by the Web API
304
306
305
307
1. Add the `Microsoft.Identity.Web.csproj` project which is located at the root of this sample repo, to your solution (**Add Existing Project ...**).
306
308
1. Add a reference from your newly generated project to `Microsoft.Identity.Web` (right click on the **Dependencies** node under your new project, and choose **Add Reference ...**, and thenin the projects tab find the `Microsoft.Identity.Web` project)
@@ -323,10 +325,8 @@ using Microsoft.Identity.Web.Client.TokenCacheProviders;
`AddProtectWebApiWithMicrosoftIdentityPlatformV2` does the following:
@@ -335,7 +335,7 @@ using Microsoft.Identity.Web.Client.TokenCacheProviders;
335
335
- sets the audiences to validate
336
336
- register an issuer validator that accepts issuers to be in the Microsoft identity platform clouds.
337
337
338
-
The implementations of these classes are in the Microsoft.Identity.Web library (and folder), and they are designed to be reusable in your applications (Web apps and Web apis). You are encouraged to browse the code in the library to understand the changes in detail.
338
+
The implementations of these classes are in the `Microsoft.Identity.Web` library (and folder), and they are designed to be reusable in your applications (Web apps and Web apis). You are encouraged to browse the code in the library to understand the changes in detail.
339
339
340
340
- At the beginning of the `Configure` method, insert `app.UseSession()`. This code ensures that the session exists for the session-based token cache to work properly. You can skip this if you do not plan to use the session based token cache.
0 commit comments