JwtSecurityToken doesn't expire when it should

后端 未结 6 1934
耶瑟儿~
耶瑟儿~ 2021-02-02 07:55

I am currently using the JwtSecurityToken class in System.IdentityModels.Tokens namespace. I create a token using the following:

DateTime expires = DateTime.Utc         


        
6条回答
  •  走了就别回头了
    2021-02-02 08:47

    I just implemented a JWT token middleware too and although the examples on the internet use UtcNow, I had to use Now or the expire time is off. When I use Now, expiration is spot on.

提交回复
热议问题