'What are the default Lifetime values for openiddict tokens

Very simple question, i would just like to know what the default values are set in openiddict 3.0+

Tokens are

  • AccessToken
  • AuthorizationToken
  • DeviceCodeToken
  • IdentityToken
  • RefreshToken
  • UserCodeToken

Thanks in advance.



Solution 1:[1]

You find the default lifetimes of the different tokens in the source code here:

https://github.com/openiddict/openiddict-core/blob/dev/src/OpenIddict.Server/OpenIddictServerOptions.cs

The most important lifetimes are:

public TimeSpan? AuthorizationCodeLifetime { get; set; } = TimeSpan.FromMinutes(5);
public TimeSpan? AccessTokenLifetime { get; set; } = TimeSpan.FromHours(1);
public TimeSpan? IdentityTokenLifetime { get; set; } = TimeSpan.FromMinutes(20);
public TimeSpan? RefreshTokenLifetime { get; set; } = TimeSpan.FromDays(14);
public TimeSpan? UserCodeLifetime { get; set; } = TimeSpan.FromMinutes(10);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1