I'm unable to understand how long the JWT token lives.
= 120 / 60 = 2 minutes
What's the purpose of IdentityTokenLifetime
?
= 120 / 60 = 2 minutes
= 300 / 60 = 5 minutes
Judging by the weird summary comment information, I don't really understand how long the JWT token lives in minutes.
public static IEnumerable<Client> GetClients(IConfiguration configuration) =>
new List<Client>
{
new()
{
ClientName = configuration["AuthConfiguration:ClientName"],
ClientId = configuration["AuthConfiguration:ClientId"],
ClientSecrets = { new Secret(configuration["AuthConfiguration:ClientSecret"].Sha256()) },
AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials,
AccessTokenType = AccessTokenType.Jwt,
AllowOfflineAccess = true,
AccessTokenLifetime = 120,
IdentityTokenLifetime = 120,
UpdateAccessTokenClaimsOnRefresh = true,
SlidingRefreshTokenLifetime = 300,
RefreshTokenExpiration = TokenExpiration.Absolute,
RefreshTokenUsage = TokenUsage.OneTimeOnly,
AlwaysSendClientClaims = true,
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.OfflineAccess,
configuration["AuthConfiguration:ApiName"]
}
}
};
From your example, once authentication succeeds, the following tokens are created:
To obtain lifetime in minutes for each token divide seconds by 60.