I'm using the Identity Server 3 OpenID Connect to create a Hybrid client that will have long-lived access (Allowing users to stay signed in for 5 years without needing to enter their credentials)
I have defined an In-Memory configuration store client like so:
new Client
{
Enabled = true,
ClientId = MyClientApp.Id,
ClientUri = MyClientApp.Uri,
ClientName = MyClientApp.Name,
Flow = Flows.Hybrid,
AllowAccessToAllScopes = true,
IdentityTokenLifetime = 300,
AccessTokenLifetime = 3600,
RefreshTokenExpiration = TokenExpiration.Absolute,
AbsoluteRefreshTokenLifetime = (int)TimeSpan.FromDays(1825).TotalSeconds,
RefreshTokenUsage = TokenUsage.OneTimeOnly,
UpdateAccessTokenClaimsOnRefresh = true,
RequireConsent = false,
RedirectUris = new List<string>
{
MyClientApp.Uri
},
PostLogoutRedirectUris = new List<string>
{
MyClientApp.Uri
},
ClientSecrets = new List<Secret>
{
new Secret(MyClientApp.Secret.Sha256())
}
},
Where:
MyClientApp.Id = test.client
MyClientApp.Uri = https://testclient.trx.com
MyClientApp.Name = My Test Client
The Access Token will expire in 3600 seconds (1 hour)
The Identity Token will expire in 300 seconds (5 minutes),
The Refresh Token (Absolute) will expire in 5 years
Is this the correct way to define a Client that meets my requirements?
Requirements:
User Signs in (authenticates) one time
User will remain signed in without the session expiring in 5 years
User will need to enter their credentials again after 5 years
I'd appreciate any help
Thank You