0
jackmcelhinney created
- ABP Framework version: v6.0.2
- UI type: Angular
- DB provider: EF Core
- Identity Server Separated (Angular): no
After updating to OpenIddict, we want to adjust the token lifetimes and pruning behavior. We successfully changed the lifetimes with PreConfigure<OpenIddictServerBuilder>
in the Host module, but PreConfigure<TokenCleanupOptions>
is not working.
Host module:
public override void PreConfigureServices(ServiceConfigurationContext context)
{
...
PreConfigure<OpenIddictServerBuilder>(builder =>
{
...
builder.SetRefreshTokenLifetime(TimeSpan.FromMinutes(15)); // Test lifetime
});
PreConfigure<TokenCleanupOptions>(options =>
{
options.CleanupPeriod = 60000;
options.MinimumAuthorizationLifespan = TimeSpan.FromMinutes(15);
options.MinimumTokenLifespan = TimeSpan.FromMinutes(15);
});
...
}
With these values, the refresh token lifetime is set to 15 minutes, but the pruning job still runs once an hour and does not use the new minimum lifespans. Is this a bug or is something wrong with this configuration?
Thanks!
3 Answer(s)
-
0
hi
public override void ConfigureServices(ServiceConfigurationContext context) { Configure<TokenCleanupOptions>(options => { options.CleanupPeriod = 60000; //Default: 3,600,000 ms, 1 hour options.MinimumAuthorizationLifespan = TimeSpan.FromMinutes(15); options.MinimumTokenLifespan = TimeSpan.FromMinutes(15); }); }
-
0
Thanks @maliming that worked. This section of the docs may need to be updated to use
Configure
instead ofPreConfigure
:https://docs.abp.io/en/abp/latest/Modules/OpenIddict#automatically-removing-orphaned-tokens-authorizations
-
0
Thanks