I can authenticate to my ASP.NET Core 2.2 web api using a JWT but the Name
property of the Identity
is null.
The claim is there, though.
Here's the JWT which is decomposed:
{
"id": "1-A",
"name": "Pure Krome",
"email": "<snip>",
"picture": "https://<snip>",
"locale": "en-au",
"permissions": [
<snip>
],
"iss": "<snip>",
"sub": "google-oauth2|<snip>",
"aud": "<snip>",
"exp": 1597609078,
"iat": 1496325742
}
and here's what the server is seeing:
also .. it seems to "recognise" my email claim, though? (note: I've just obfuscated the real email value)
So I thought name
isn't a recognised claim .. so I tried seeing if there's some standard rules for this and found IANA has a list of reserved and custom claims. name
is the first one for custom claims.
Is there some trick I need to do to get ASP.NET Core security to recognise my name
claim as NameClaimType
?
Why does email
claim get recognised?