I am writing knockout application with Wep Api as a backend. I used this tutorial to implement token bearer authorization, so I have access tokens, however login functionality is provided externally. What I need to implement is logging out after certain time, e.g. 1 hour, and if all time active - after longer time - 10 hours. So I have my settings like below:
OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
{
AllowInsecureHttp = true,
TokenEndpointPath = new PathString("/token"),
AccessTokenExpireTimeSpan = TimeSpan.FromHours(10),
Provider = container.Resolve<IOAuthAuthorizationServerProvider>()
};
And it works - access is being revoked after 10 hours, but how to achieve logging out after being inactive for 1 hour? I am wondering about certain usage of refresh tokens or implementing sessions into the app.