File tree 2 files changed +2
-6
lines changed
2. Web API now calls Microsoft Graph/TodoListService
2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ public void ConfigureServices(IServiceCollection services)
33
33
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
34
34
public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
35
35
{
36
- app . UseSession ( ) ;
37
-
38
36
if ( env . IsDevelopment ( ) )
39
37
{
40
38
// Since IdentityModel version 5.2.1 (or since Microsoft.AspNetCore.Authentication.JwtBearer version 2.2.0),
Original file line number Diff line number Diff line change @@ -38,20 +38,18 @@ public static IServiceCollection AddProtectedWebApi(
38
38
this IServiceCollection services ,
39
39
IConfiguration configuration ,
40
40
X509Certificate2 tokenDecryptionCertificate = null ,
41
- string configSectionName = "AzureAD " ,
41
+ string configSectionName = "AzureAd " ,
42
42
bool subscribeToJwtBearerMiddlewareDiagnosticsEvents = false )
43
43
{
44
44
services . AddAuthentication ( AzureADDefaults . JwtBearerAuthenticationScheme )
45
45
. AddAzureADBearer ( options => configuration . Bind ( configSectionName , options ) ) ;
46
+ services . Configure < AzureADOptions > ( options => configuration . Bind ( configSectionName , options ) ) ;
46
47
47
48
services . AddHttpContextAccessor ( ) ;
48
49
49
50
// Change the authentication configuration to accommodate the Microsoft identity platform endpoint (v2.0).
50
51
services . Configure < JwtBearerOptions > ( AzureADDefaults . JwtBearerAuthenticationScheme , options =>
51
52
{
52
- // Reinitialize the options as this has changed to JwtBearerOptions to pick configuration values for attributes unique to JwtBearerOptions
53
- configuration . Bind ( configSectionName , options ) ;
54
-
55
53
// This is an Microsoft identity platform Web API
56
54
options . Authority += "/v2.0" ;
57
55
You can’t perform that action at this time.
0 commit comments