Warm tip: This article is reproduced from stackoverflow.com, please click
asp.net asp.net-web-api oauth oauth-2.0 owin

OAuth2 WebAPI Token remove .issued and .expires

发布于 2020-04-16 11:51:43

The token is always returned following information:

{
  "access_token": ".....",
  "token_type": "bearer",
  "expires_in": 1199,
  "custom_info1": ".....",
  "custom_info2": "....",
  ".expires": "Fri, 13 Nov 2015 20:24:06 GMT",
  ".issued": "Fri, 13 Nov 2015 20:04:06 GMT"
}

Can we remove the .expires and .issued information?

Questioner
Joehom Sum
Viewed
74
DaImTo 2020-02-04 15:47

Tokens normally contain an expires_in field which is used to denote how long it will be good for. Systems can then save when they requested it locally and decided when it will expire.

These other two fields are not standard Identity tokens claims. They were probably added by someone to your token via the code. You should check that see why these claims were added manually to your tokens. Assuming they were created by a proper identity server and not something home grown.