File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed
Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public void ConfigureServices(IServiceCollection services)
4040 // By default, the claims mapping will map claim names in the old format to accommodate older SAML applications.
4141 // 'http://schemas.microsoft.com/ws/2008/06/identity/claims/role' instead of 'roles'
4242 // This flag ensures that the ClaimsIdentity claims collection will be built from the claims in the token
43- JwtSecurityTokenHandler . DefaultMapInboundClaims = false ;
43+ // JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
4444
4545 // Token acquisition service based on MSAL.NET
4646 // and chosen token cache implementation
Original file line number Diff line number Diff line change @@ -51,13 +51,10 @@ public void ConfigureServices(IServiceCollection services)
5151 // By default, the claims mapping will map claim names in the old format to accommodate older SAML applications.
5252 // 'http://schemas.microsoft.com/ws/2008/06/identity/claims/role' instead of 'roles'
5353 // This flag ensures that the ClaimsIdentity claims collection will be built from the claims in the token
54- JwtSecurityTokenHandler . DefaultMapInboundClaims = false ;
54+ // JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
5555
56- services . AddProtectedWebApi ( Configuration ) ;
57- services . Configure < JwtBearerOptions > ( AzureADDefaults . JwtBearerAuthenticationScheme , options =>
58- {
59- options . TokenValidationParameters . NameClaimType = "name" ;
60- } ) ;
56+ services . AddProtectedWebApi ( Configuration )
57+ . AddInMemoryTokenCaches ( ) ;
6158
6259 services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_2 ) ;
6360 }
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public static IServiceCollection AddProtectedWebApi(
4141 string configSectionName = "AzureAD" ,
4242 bool subscribeToJwtBearerMiddlewareDiagnosticsEvents = false )
4343 {
44- services . Configure < AzureADOptions > ( options => configuration . Bind ( configSectionName , options ) ) ;
44+ // services.Configure<AzureADOptions>(options => configuration.Bind(configSectionName, options));
4545 services . AddAuthentication ( AzureADDefaults . JwtBearerAuthenticationScheme )
4646 . AddAzureADBearer ( options => configuration . Bind ( configSectionName , options ) ) ;
4747
You can’t perform that action at this time.
0 commit comments