79518420

Date: 2025-03-18 18:57:09
Score: 0.5
Natty:
Report link

I am able to resolve it, but not in a manner that I'm extremely satisfied with.

I've replaced the following

.AddMicrosoftAccount(options =>
    {
        options.ClientId = aadConfig.ClientId;
        options.ClientSecret = aadConfig.ClientSecret;
        options.AuthorizationEndpoint = aadConfig.AuthorityEndpoint;
        options.TokenEndpoint = aadConfig.TokenEndpoint;
    })

With this, this somehow resolves it.

AddOpenIdConnect("Microsoft", options =>
    {
        options.Authority = aadConfig.Authority;
        options.ClientId = aadConfig.ClientId;
        options.ClientSecret = aadConfig.ClientSecret;
        options.ResponseType = OpenIdConnectResponseType.Code;
        options.SaveTokens = true;
        options.GetClaimsFromUserInfoEndpoint = true;
        options.MapInboundClaims = false;
        options.TokenValidationParameters.NameClaimType = JwtRegisteredClaimNames.Name;
    })
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Richard Vo