From d5aa7b562470a2be0587585dbdb7b6f7c7dbfd2b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 3 Mar 2020 08:32:50 -0500 Subject: [PATCH] allow configuring the validation urls for yubico otp servers --- src/Core/GlobalSettings.cs | 1 + src/Core/Identity/YubicoOtpTokenProvider.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Core/GlobalSettings.cs b/src/Core/GlobalSettings.cs index e676d94205..3c7a0d4d70 100644 --- a/src/Core/GlobalSettings.cs +++ b/src/Core/GlobalSettings.cs @@ -179,6 +179,7 @@ namespace Bit.Core { public string ClientId { get; set; } public string Key { get; set; } + public string[] ValidationUrls { get; set; } } public class DuoSettings diff --git a/src/Core/Identity/YubicoOtpTokenProvider.cs b/src/Core/Identity/YubicoOtpTokenProvider.cs index 4db6b0c505..27a7883401 100644 --- a/src/Core/Identity/YubicoOtpTokenProvider.cs +++ b/src/Core/Identity/YubicoOtpTokenProvider.cs @@ -67,6 +67,10 @@ namespace Bit.Core.Identity } var client = new YubicoClient(_globalSettings.Yubico.ClientId, _globalSettings.Yubico.Key); + if(_globalSettings.Yubico.ValidationUrls != null && _globalSettings.Yubico.ValidationUrls.Length > 0) + { + client.SetUrls(_globalSettings.Yubico.ValidationUrls); + } var response = await client.VerifyAsync(token); return response.Status == YubicoResponseStatus.Ok; }