Get User Id from Web API

This commit is contained in:
Paul Schneider
2025-02-17 23:56:28 +00:00
parent 84e58bb9eb
commit 45cc299866
26 changed files with 83 additions and 60 deletions

View File

@ -11,6 +11,7 @@
*/
using System.IdentityModel.Tokens.Jwt;
using Microsoft.AspNetCore.Authentication;
JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
@ -36,7 +37,10 @@ builder.Services
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("scope2");
options.MapInboundClaims = true;
options.ClaimActions.MapUniqueJsonKey("preferred_username","preferred_username");
options.ClaimActions.MapUniqueJsonKey("gender", "gender");
options.SaveTokens = true;
});