JwtSecurityToken doesn't expire when it should

后端 未结 6 1937
耶瑟儿~
耶瑟儿~ 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:40

    Below link give you the exact answer, as by default MS have expire time of 5mins. So either you have to make it custom or time which you will give in expires: DateTime.Now.AddSeconds(30) 30seconds in above line will be added in expirey time. So total expire time will be 5mins and 30secs

    https://github.com/IdentityServer/IdentityServer3/issues/1251

    Hope this will help.

提交回复
热议问题