title: How can I figure out why ASP.NET web api access token expired?
body: <p>I have a web service implemented by ASP.NET WEB API 2.0 and secure it with bearer token as as described in article <a href="https://www.asp.net/web-api/overview/security/individual-accounts-in-web-api" rel="nofollow noreferrer">here</a>.</p>
  
  <p>And I set the expiry period to 180 days using code </p>
  
  <pre><code>OAuthOptions = new OAuthAuthorizationServerOptions {
                  TokenEndpointPath = new PathString("/Token"),
                  Provider = new ApplicationOAuthProvider(PublicClientId),
                  AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
                  AccessTokenExpireTimeSpan = TimeSpan.FromDays(30),
                  AllowInsecureHttp = true
              };
  </code></pre>
  
  <p>However, I found that my token expired before 30 days end.</p>
  
  <p>How can I found why my token expired?
  And what detail does the access token contain? How can I parse the bearer token?</p>
  
  <p>I host my web server in Azure web apps.</p>
  
  <p>Thanks.</p>