Skip to content

Commit

Permalink
Additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmartinezramirez committed Oct 30, 2024
1 parent ec5a88b commit 7d959a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Snowflake.Data/Core/Authenticator/IAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand Down
3 changes: 2 additions & 1 deletion Snowflake.Data/Core/Authenticator/MFACacheAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit 7d959a3

Please sign in to comment.