0

Forum


You need to log in to create posts and topics.

Ticket Session Time Length

Sorry for such a simple question, but where do I tweak how long the user cookie lasts? It seems to only last for 30 minutes, and then I start getting 401 unauthorized errors. Thank you.

  • Cookies are not used in the template. I believe you're referring to authorization tokens (accessToken, identityToken, refreshToken)
  • You shouldn't have to extend the token lifetime. Because with the implementation in the template, the tokens are automatically renewed when they expire. If your's is not renewing for some reason you need to debug it from this file: endpoint-factory.service.ts
  • If you still need to extend the token lifetime you can do it from: Startup.cs:
                options.SetAccessTokenLifetime(TimeSpan.FromMinutes(YOUR_VALUE));
                options.SetAuthorizationCodeLifetime(TimeSpan.FromMinutes(YOUR_VALUE));
                options.SetIdentityTokenLifetime(TimeSpan.FromMinutes(YOUR_VALUE));
                options.SetRefreshTokenLifetime(TimeSpan.FromMinutes(YOUR_VALUE));
  • See this stackoverflow post
  • Documentation can be found here
    AuthorizationCodeLifetime
    AccessTokenLifetime
    IdentityTokenLifetime
    RefreshTokenLifetime
    TimeSpan The period of time
    the token or code
    remains valid after
    being issued.
    5 minutes
    1 hour
    20 minutes
    14 days

 

Ah, my mistake. Thank you very much!