Auth0 Home Blog Docs

ClaimsPrincipal missing claims in aspnet core 2.0 quickstart

net-core
dotnet-core
missing-claims-afer-

#1

I pulled down the the .Net Core 2.0 quickstart. I have the scope set to openid on the OIDC options. When the claims principal is populated I only have a nameidentifier claim which I assume is mapped over from the sub claim. The iss, sub, aud, exp, and iat claims are not in the claims for the ClaimsPrincipal. I’ve inspected the id_token that was returned and all the claims are present. I assume this is some change in core 2.0 as I have 1.1 apps and these claims are populated on the principal. Has anyone else come across this? I can explicitly set them, but it seems like this should be easier to get these values on the principal.


#2

Found it. It’s options.ClaimActions.Remove(“exp”) on the OidcOptions. See here for more detail.
https://github.com/aspnet/Security/issues/1386


#3