I would like to extend the access token expiration from ASP.Net. Below is the code from App_Start\Startup.Auth.cs
OAuthOptions = new OAuthAuthorizationServerOptions
{
TokenEndpointPath = new PathString("/Token"),
Provider = new ApplicationOAuthProvider(PublicClientId),
//AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(364),
AllowInsecureHttp = true // In production mode set AllowInsecureHttp = false
};
However, the token was not last for a year if I deployed to live site. I used postman to test, managed to get the token, but the token would be expired after 20minutes.
Providers/ApplicationOAuthProvider.cs
public ApplicationOAuthProvider(string publicClientId)
{
if (publicClientId == null)
{
throw new ArgumentNullException("publicClientId");
}
_publicClientId = publicClientId;
}
Result from Postman
{
"access_token": "accesstoken",
"token_type": "bearer",
"expires_in": 86399,
"userName": "admin@admin",
".issued": "Thu, 11 Oct 2018 04:39:03 GMT",
".expires": "Fri, 12 Oct 2018 04:39:03 GMT"
}
Is there anything I can do to extend in the ASP.Net MVC way?