Last post Nov 22, 2020 04:22 PM by reinux
Nov 21, 2020 05:24 AM|Amplitude|LINK
So this fails:
Expires = DateTime.Now.AddMinutes(30),
Expires = DateTime.Now.AddHours(7),
If I go below 7 hours or attempt to use seconds I get the following erros:
IDX12401: Expires: 'System.DateTime' must be after NotBefore: 'System.DateTime'.
I think I understand the error but I am not certain how to resolve it.
SigningCredentials signingCredentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha512Signature);
SecurityTokenDescriptor securityTokenDescriptor = new SecurityTokenDescriptor
Subject = new ClaimsIdentity(claims),
Expires = DateTime.Now.AddHours(6),
SigningCredentials = signingCredentials
Nov 22, 2020 04:22 PM|reinux|LINK
If I go below 7 hours
That would be because you're in UTC-7, ie somewhere in western/midwestern North America :D
You need to use System.DateTime.UtcNow as opposed to System.DateTime.Now.