IdentityServer / IdentityServer4

OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
https://identityserver.io
Apache License 2.0
9.23k stars 4.01k forks source link

IAT claim not getting inserted in the JWT Token #5394

Closed SurajRtistiq closed 2 years ago

SurajRtistiq commented 2 years ago

Question

I've implemented the resource owner password grant and trying to add the IssuedAt Claim to my JWT Token. But when the token is generated, the "iat" claim is not coming.

Code Snippet

var claims = new List<Claim>
{
new Claim(JwtClaimTypes.Id, user.Id.ToString()),
new Claim(JwtClaimTypes.Email, user.Email),
new Claim(JwtClaimTypes.Name, user.UserName),
new Claim(JwtClaimTypes.IssuedAt, DateTime.UtcNow.ToEpochTime().ToString(), ClaimValueTypes.Integer64),
};

Cannot figure out why Identity server is not inserting the iat (issued at) claim.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.