diff --git a/WebCodeFlowPkceClient/HostingExtensions.cs b/WebCodeFlowPkceClient/HostingExtensions.cs index 3e7ef1e..2588292 100644 --- a/WebCodeFlowPkceClient/HostingExtensions.cs +++ b/WebCodeFlowPkceClient/HostingExtensions.cs @@ -1,9 +1,10 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Microsoft.IdentityModel.JsonWebTokens; using Microsoft.IdentityModel.Logging; using Serilog; -using System.IdentityModel.Tokens.Jwt; +//using System.IdentityModel.Tokens.Jwt; namespace WebCodeFlowPkceClient; @@ -40,6 +41,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde options.GetClaimsFromUserInfoEndpoint = true; options.ClaimActions.MapUniqueJsonKey("preferred_username", "preferred_username"); options.ClaimActions.MapUniqueJsonKey("gender", "gender"); + options.MapInboundClaims = false; }); services.AddAuthorization(); @@ -50,8 +52,9 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde public static WebApplication ConfigurePipeline(this WebApplication app) { - IdentityModelEventSource.ShowPII = true; - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); + //IdentityModelEventSource.ShowPII = true; + //JsonWebTokenHandler.DefaultInboundClaimTypeMap.Clear(); // .NET 8 + //JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); app.UseSerilogRequestLogging();