diff --git a/Snowflake.Data/Core/Authenticator/IAuthenticator.cs b/Snowflake.Data/Core/Authenticator/IAuthenticator.cs index f6497e980..f5f02782c 100644 --- a/Snowflake.Data/Core/Authenticator/IAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/IAuthenticator.cs @@ -145,7 +145,9 @@ private SFRestRequest BuildLoginRequest() }; SetSpecializedAuthenticatorData(ref data); - return data.HttpTimeout.HasValue ? session.BuildTimeoutRestRequest(loginUrl, new LoginRequest() { data = data }, data.HttpTimeout.Value) : session.BuildTimeoutRestRequest(loginUrl, new LoginRequest() { data = data }); + return data.HttpTimeout.HasValue ? + session.BuildTimeoutRestRequest(loginUrl, new LoginRequest() { data = data }, data.HttpTimeout.Value) : + session.BuildTimeoutRestRequest(loginUrl, new LoginRequest() { data = data }); } } diff --git a/Snowflake.Data/Core/Authenticator/MFACacheAuthenticator.cs b/Snowflake.Data/Core/Authenticator/MFACacheAuthenticator.cs index f72509b59..2d398352d 100644 --- a/Snowflake.Data/Core/Authenticator/MFACacheAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/MFACacheAuthenticator.cs @@ -12,6 +12,7 @@ namespace Snowflake.Data.Core.Authenticator class MFACacheAuthenticator : BaseAuthenticator, IAuthenticator { public const string AUTH_NAME = "username_password_mfa"; + private const int _MFA_LOGIN_HTTP_TIMEOUT = 60; internal MFACacheAuthenticator(SFSession session) : base(session, AUTH_NAME) { @@ -35,7 +36,7 @@ protected override void SetSpecializedAuthenticatorData(ref LoginRequestData dat // Only need to add the password to Data for basic authentication data.password = session.properties[SFSessionProperty.PASSWORD]; data.SessionParameters[SFSessionParameter.CLIENT_REQUEST_MFA_TOKEN] = true; - data.HttpTimeout = TimeSpan.FromSeconds(60); + data.HttpTimeout = TimeSpan.FromSeconds(_MFA_LOGIN_HTTP_TIMEOUT); if (!string.IsNullOrEmpty(session._mfaToken?.ToString())) { data.Token = SecureStringHelper.Decode(session._mfaToken);