title: Identity Token-Based token expire after 15 min on server but work on local
body: <p>I use identity token-based and angularjs in my project, The token works properly in the local environment but expires in the server after 15 minutes. I set AccessTokenExpireTimeSpan = TimeSpan.FromDay(14) in middleware and check expire_in value in token, expire_in:1209599 equal to 14 day.  </p>
  
  <p><strong>Apparently everything is right</strong></p>
  
  <pre><code>OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions() {
  
              AllowInsecureHttp = true,
              TokenEndpointPath = new PathString("/token"),
              AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
              Provider = new ApplicationOAuthProvider(PublicClientId),
          };
  
          app.UseOAuthAuthorizationServer(OAuthServerOptions);
          app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
  </code></pre>
  
  <p>My server is Plesk</p>
  
  <p>My Questions :</p>
  
  <p><strong>1- Should I set this setting(Expire Timeout) elsewhere?</strong>
  <a href="https://stackoverflow.com/questions/33701398/oauth2-webapi-token-expiration">OAuth2 WebApi Token Expiration</a></p>
  
  <p><strong>2- Do you really have to use RefreshToken?</strong>
  <a href="http://bitoftech.net/2014/07/16/enable-oauth-refresh-tokens-angularjs-app-using-asp-net-web-api-2-owin/" rel="nofollow noreferrer">http://bitoftech.net/2014/07/16/enable-oauth-refresh-tokens-angularjs-app-using-asp-net-web-api-2-owin/</a></p>
  
  <p><strong>3- Should I Config Plesk ???</strong></p>
  
  <p><strong>4- Is related to the virtual server and machine key ???</strong> 
  <a href="https://stackoverflow.com/questions/29143794/asp-net-identity-expire-bearer-token-after-20-min">asp.net identity expire bearer token after 20 min</a></p>
  
  <p><strong>Thank you for more details</strong></p>