File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
2. Web API now calls Microsoft Graph/TodoListService Expand file tree Collapse file tree 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)
3333 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
3434 public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
3535 {
36- app . UseSession ( ) ;
37-
3836 if ( env . IsDevelopment ( ) )
3937 {
4038 // 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(
3838 this IServiceCollection services ,
3939 IConfiguration configuration ,
4040 X509Certificate2 tokenDecryptionCertificate = null ,
41- string configSectionName = "AzureAD " ,
41+ string configSectionName = "AzureAd " ,
4242 bool subscribeToJwtBearerMiddlewareDiagnosticsEvents = false )
4343 {
4444 services . AddAuthentication ( AzureADDefaults . JwtBearerAuthenticationScheme )
4545 . AddAzureADBearer ( options => configuration . Bind ( configSectionName , options ) ) ;
46+ services . Configure < AzureADOptions > ( options => configuration . Bind ( configSectionName , options ) ) ;
4647
4748 services . AddHttpContextAccessor ( ) ;
4849
4950 // Change the authentication configuration to accommodate the Microsoft identity platform endpoint (v2.0).
5051 services . Configure < JwtBearerOptions > ( AzureADDefaults . JwtBearerAuthenticationScheme , options =>
5152 {
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-
5553 // This is an Microsoft identity platform Web API
5654 options . Authority += "/v2.0" ;
5755
You can’t perform that action at this time.
0 commit comments