❔ claim type for Id(Primery key) of a Model
what claim type i can user to store Id(Primery key) of a Model
3 Replies
If you are using JWT then the standard is storing user Id in the "
sub
" (Subject) claim. If you have a reference to System.IndentityModel.Token.Jwt
you can use JwtRegisteredClaimNames.Sub
for statically typed claim type.
https://learn.microsoft.com/en-us/dotnet/api/system.identitymodel.tokens.jwt.jwtregisteredclaimnames.subalso the claim type can be any string
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.