File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
4-WebApp-your-API/TodoListService Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ public void ConfigureServices(IServiceCollection services)
5353 // This flag ensures that the ClaimsIdentity claims collection will be built from the claims in the token
5454 //JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
5555
56- services . AddHttpContextAccessor ( ) ;
57-
5856 services . AddProtectedWebApi ( Configuration ) ;
5957
6058 services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ public static IServiceCollection AddProtectedWebApi(
4444 services . AddAuthentication ( AzureADDefaults . JwtBearerAuthenticationScheme )
4545 . AddAzureADBearer ( options => configuration . Bind ( configSectionName , options ) ) ;
4646
47+ services . AddHttpContextAccessor ( ) ;
48+
4749 // Change the authentication configuration to accommodate the Microsoft identity platform endpoint (v2.0).
4850 services . Configure < JwtBearerOptions > ( AzureADDefaults . JwtBearerAuthenticationScheme , options =>
4951 {
You can’t perform that action at this time.
0 commit comments