0

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.

And I set the expiry period to 180 days using code

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.

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.

Thanks.

Esko
  • 4,109
  • 2
  • 22
  • 37
timewalker
  • 29
  • 7

1 Answers1

0

You could use https://jwt.io/ to decode the bearer token once you have created one.

Examine the expiry date on the token matches what you are expecting.

Derek
  • 8,300
  • 12
  • 56
  • 88