In the sample project for Hybrid and API Access
The Users have claims for "website", however when I run the project, website does not show up in the claims list. What is missing?
@egmfrs Have you made any progress with this?
@nicbavetta nope
It's because Microsoft does not map all claims by default from the userinfo into the claims principal. You have to say what claims you want included. Here's what they include by default:
And here's how you'd add "website":
.AddOpenIdConnect("oidc", options =>
{
// ...
options.ClaimActions.MapUniqueJsonKey("website", "website");
}
It's unfortunate that they don't map what comes back from userinfo automatically. Also unfortunate that they're missing 2/3 of the standard claim types.
// @tratcher
Closing. If you still have issues, feel free to reopen.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
It's because Microsoft does not map all claims by default from the userinfo into the claims principal. You have to say what claims you want included. Here's what they include by default:
https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs#L63
And here's how you'd add "website":
It's unfortunate that they don't map what comes back from userinfo automatically. Also unfortunate that they're missing 2/3 of the standard claim types.
// @tratcher