mirror of
https://github.com/bitwarden/server
synced 2026-01-18 16:33:29 +00:00
yubico global settings
This commit is contained in:
@@ -9,6 +9,13 @@ namespace Bit.Core.Identity
|
||||
{
|
||||
public class YubicoOtpTokenProvider : IUserTwoFactorTokenProvider<User>
|
||||
{
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
|
||||
public YubicoOtpTokenProvider(GlobalSettings globalSettings)
|
||||
{
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<User> manager, User user)
|
||||
{
|
||||
var provider = user.GetTwoFactorProvider(TwoFactorProviderType.YubiKey);
|
||||
@@ -41,7 +48,7 @@ namespace Bit.Core.Identity
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
var client = new YubicoClient("TODO", "TODO");
|
||||
var client = new YubicoClient(_globalSettings.Yubico.ClientId, _globalSettings.Yubico.ClientId);
|
||||
var response = client.Verify(token);
|
||||
return Task.FromResult(response.Status == YubicoResponseStatus.Ok);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user