diff --git a/src/Core/Auth/Identity/TemporaryDuoWebV4SDKService.cs b/src/Core/Auth/Identity/TemporaryDuoWebV4SDKService.cs index 0f9f982a8b..b3f39347ed 100644 --- a/src/Core/Auth/Identity/TemporaryDuoWebV4SDKService.cs +++ b/src/Core/Auth/Identity/TemporaryDuoWebV4SDKService.cs @@ -4,6 +4,7 @@ using Bit.Core.Context; using Bit.Core.Entities; using Bit.Core.Settings; using Bit.Core.Tokens; +using Microsoft.Extensions.Logging; using Duo = DuoUniversal; namespace Bit.Core.Auth.Identity; @@ -25,6 +26,7 @@ public class TemporaryDuoWebV4SDKService : ITemporaryDuoWebV4SDKService private readonly ICurrentContext _currentContext; private readonly GlobalSettings _globalSettings; private readonly IDataProtectorTokenFactory _tokenDataFactory; + private readonly ILogger _logger; /// /// Constructor for the DuoUniversalPromptService. Used to supplement v2 implementation of Duo with v4 SDK @@ -34,11 +36,13 @@ public class TemporaryDuoWebV4SDKService : ITemporaryDuoWebV4SDKService public TemporaryDuoWebV4SDKService( ICurrentContext currentContext, GlobalSettings globalSettings, - IDataProtectorTokenFactory tokenDataFactory) + IDataProtectorTokenFactory tokenDataFactory, + ILogger logger) { _currentContext = currentContext; _globalSettings = globalSettings; _tokenDataFactory = tokenDataFactory; + _logger = logger; } /// @@ -129,8 +133,9 @@ public class TemporaryDuoWebV4SDKService : ITemporaryDuoWebV4SDKService (string)provider.MetaData["Host"], redirectUri).Build(); - if (!await client.DoHealthCheck()) + if (!await client.DoHealthCheck(true)) { + _logger.LogError("Unable to connect to Duo. Health check failed."); return null; } return client;