Add hashing and other security features #12
@ -26,7 +26,7 @@ public static class DependencyInjection
|
||||
Secret = configuration["SECURITY_HASH_TOKEN"]
|
||||
});
|
||||
|
||||
var lifeTimeLogin = TimeSpan.FromMinutes(int.Parse(configuration["SECURITY_LIFE_TIME_1_FA"]!));
|
||||
var lifeTimePreAuthToken = TimeSpan.FromMinutes(int.Parse(configuration["SECURITY_LIFE_TIME_1_FA"]!));
|
||||
|
||||
services.AddSingleton(provider =>
|
||||
{
|
||||
@ -34,7 +34,21 @@ public static class DependencyInjection
|
||||
|
||||
return new PreAuthService(cache)
|
||||
{
|
||||
Lifetime = lifeTimeLogin
|
||||
Lifetime = lifeTimePreAuthToken
|
||||
};
|
||||
});
|
||||
|
||||
var lifeTimeRefreshToken = TimeSpan.FromMinutes(int.Parse(configuration["SECURITY_LIFE_TIME_RT"]!));
|
||||
|
||||
services.AddSingleton(provider =>
|
||||
{
|
||||
var cacheService = provider.GetRequiredService<ICacheService>();
|
||||
var accessTokenService = provider.GetRequiredService<IAccessToken>();
|
||||
var revokedTokenService = provider.GetRequiredService<IRevokedToken>();
|
||||
|
||||
return new AuthService(cacheService, accessTokenService, revokedTokenService)
|
||||
{
|
||||
Lifetime = lifeTimeRefreshToken
|
||||
};
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user