Skip to content

Commit f241637

Browse files
committed
Adding the authentication scheme for the Web API
otherwise by default this will be OpenIdConnect
1 parent 328366e commit f241637

File tree

1 file changed

+2
-2
lines changed
  • 4-WebApp-your-API/4-2-B2C/TodoListService

1 file changed

+2
-2
lines changed

4-WebApp-your-API/4-2-B2C/TodoListService/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public void ConfigureServices(IServiceCollection services)
3434
// JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
3535

3636
// Adds Microsoft Identity platform (AAD v2.0) support to protect this Api
37-
services.AddAuthentication()
37+
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
3838
.AddMicrosoftWebApi(options =>
3939
{
4040
Configuration.Bind("AzureAdB2C", options);
4141

4242
options.TokenValidationParameters.NameClaimType = "name";
4343
},
44-
options => { Configuration.Bind("AzureAdB2C", options); });
44+
options => { Configuration.Bind("AzureAdB2C", options); });
4545

4646
services.AddControllers();
4747
services.AddAuthorization(options =>

0 commit comments

Comments
 (0)