Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Nov 5, 2023
1 parent 441cc6b commit 4e48a95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion WebCodeFlowPkceClient/HostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.IdentityModel.JsonWebTokens;
using Microsoft.IdentityModel.Logging;
using Microsoft.IdentityModel.Tokens;
using Serilog;
using System.IdentityModel.Tokens.Jwt;
//using System.IdentityModel.Tokens.Jwt;

namespace WebCodeFlowPkceClient;
Expand Down Expand Up @@ -42,6 +44,11 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
options.ClaimActions.MapUniqueJsonKey("preferred_username", "preferred_username");
options.ClaimActions.MapUniqueJsonKey("gender", "gender");
options.MapInboundClaims = false;
//options.TokenValidationParameters = new TokenValidationParameters
//{
// NameClaimType = "email",
// //RoleClaimType = "Role",
//};
});

services.AddAuthorization();
Expand All @@ -54,7 +61,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app)
{
//IdentityModelEventSource.ShowPII = true;
//JsonWebTokenHandler.DefaultInboundClaimTypeMap.Clear(); // .NET 8
//JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); // < .NET 8

app.UseSerilogRequestLogging();

Expand Down

0 comments on commit 4e48a95

Please sign in to comment.