I have a Blazor WASM application.
I am getting the id token and putting it in the header for a http api call to aws apigateway v2 http api.
In a controller method, I am spilling info to the log.
The token looks like this
{
“given_name”: “XXX”,
“family_name”: “XXX”,
“nickname”: “XXX”,
“name”: “XXXX”,
“picture”: “https://lh3.googleusercontent.com/a-/XXXXX=s96-c”,
“locale”: “en”,
“updated_at”: “2021-04-18T20:56:16.040Z”,
“iss”: “https://XXXXXX.auth0.com/”,
“sub”: "google-oauth2|987987987987,
“aud”: “XXXXXX”,
“iat”: 1618784322,
“exp”: 1618820322
}
In the lambda function backing the http api, all of the claims are there…
In the controller I am logging as below:
LambdaLogger.Log($"{nameof(Ping)}{nameof(User)}={User}");
LambdaLogger.Log($"{nameof(Ping)}{nameof(User.Identity)}={User.Identity}");
LambdaLogger.Log($"{nameof(Ping)}{nameof(User.Identity.Name)}={User.Identity.Name}");
LambdaLogger.Log($"{nameof(Ping)}{nameof(User.Claims)}={string.Join(Environment.NewLine,User.Claims.Select(_=>$"{_.Type}={_.Value}"))}");
But the “User.Identity.Name” is empty/null.
Why?