[英]How can I figure out why ASP.NET web api access token expired?
I have a web service implemented by ASP.NET WEB API 2.0 and secure it with bearer token as as described in article here . 我有一个由ASP.NET WEB API 2.0实现的Web服务,并按照此处的文章所述,使用承载令牌来保护它。
And I set the expiry period to 180 days using code 我使用代码将有效期设置为180天
OAuthOptions = new OAuthAuthorizationServerOptions {
TokenEndpointPath = new PathString("/Token"),
Provider = new ApplicationOAuthProvider(PublicClientId),
AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(30),
AllowInsecureHttp = true
};
However, I found that my token expired before 30 days end. 但是,我发现我的令牌在30天结束之前已过期。
How can I found why my token expired? 我如何找到我的令牌为何过期的原因? And what detail does the access token contain?
访问令牌包含哪些细节? How can I parse the bearer token?
如何解析不记名令牌?
I host my web server in Azure web apps. 我将Web服务器托管在Azure Web应用程序中。
Thanks. 谢谢。
You could use https://jwt.io/ to decode the bearer token once you have created one. 创建令牌后,您可以使用https://jwt.io/解码该承载令牌。
Examine the expiry date on the token matches what you are expecting. 检查令牌上的到期日期是否符合您的期望。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.