Skip to content

Commit 8fddafa

Browse files
author
Kalyan Krishna
authored
added a missing step omitted by the latest vs.net core template
added a missing step omitted by the latest vs.net core template
1 parent 4b12ba0 commit 8fddafa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: 4-WebApp-your-API/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
283283
.AddMsal(new string[] { Configuration["TodoList:TodoListScope"] })
284284
.AddInMemoryTokenCaches();
285285
```
286+
1. Update the `Configure` method to include **app.UseAuthentication();** before **app.UseMvc();**
287+
288+
```Csharp
289+
app.UseAuthentication();
290+
app.UseMvc();
291+
```
286292
287293
### Creating the Web API project (TodoListService)
288294
@@ -328,6 +334,12 @@ using Microsoft.Identity.Web.Client.TokenCacheProviders;
328334
services.AddProtectedWebApi(Configuration)
329335
.AddInMemoryTokenCaches();
330336
```
337+
- Add the method **app.UseAuthentication()** before **app.UseMvc()** in the `Configure` method
338+
339+
```Csharp
340+
app.UseAuthentication();
341+
app.UseMvc();
342+
```
331343
332344
`AddProtectedWebApi` does the following:
333345
- add the **Jwt**BearerAuthenticationScheme (Note the replacement of **BearerAuthenticationScheme** by **Jwt**BearerAuthenticationScheme)

0 commit comments

Comments
 (0)