File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
4-WebApp-your-API/TodoListService Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ public void ConfigureServices(IServiceCollection services)
53
53
// This flag ensures that the ClaimsIdentity claims collection will be built from the claims in the token
54
54
//JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
55
55
56
- services . AddProtectedWebApi ( Configuration )
57
- . AddInMemoryTokenCaches ( ) ;
56
+ services . AddHttpContextAccessor ( ) ;
57
+
58
+ services . AddProtectedWebApi ( Configuration ) ;
58
59
59
60
services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
60
61
}
Original file line number Diff line number Diff line change @@ -44,9 +44,6 @@ public static IServiceCollection AddProtectedWebApi(
44
44
services . AddAuthentication ( AzureADDefaults . JwtBearerAuthenticationScheme )
45
45
. AddAzureADBearer ( options => configuration . Bind ( configSectionName , options ) ) ;
46
46
47
- // Add session if you are planning to use session based token cache , .AddSessionTokenCaches()
48
- // services.AddSession(); // Commented as we cannot force session on someone who wants to use an alternative token cache provider.
49
-
50
47
// Change the authentication configuration to accommodate the Microsoft identity platform endpoint (v2.0).
51
48
services . Configure < JwtBearerOptions > ( AzureADDefaults . JwtBearerAuthenticationScheme , options =>
52
49
{
You can’t perform that action at this time.
0 commit comments