From 3dda081288912e964436512469fc96e8c905ed5a Mon Sep 17 00:00:00 2001 From: Krzysztof Nozderko Date: Tue, 28 Jan 2025 19:19:50 +0100 Subject: [PATCH 1/2] SNOW-715504 Fix secondary authentication data in authenticators (#1086) --- .../Core/Authenticator/ExternalBrowserAuthenticator.cs | 2 +- Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs b/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs index baba5f8a5..11720c393 100644 --- a/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs @@ -260,7 +260,7 @@ protected override void SetSpecializedAuthenticatorData(ref LoginRequestData dat // Add the token and proof key to the Data data.Token = _samlResponseToken; data.ProofKey = _proofKey; - SetSpecializedAuthenticatorData(ref data); + SetSecondaryAuthenticationData(ref data); } private string GetLoginUrl(string proofKey, int localPort) diff --git a/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs b/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs index 44b9b8bec..24d121a2e 100644 --- a/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs @@ -75,7 +75,7 @@ protected override void SetSpecializedAuthenticatorData(ref LoginRequestData dat { // Add the token to the Data attribute data.Token = jwtToken; - SetSpecializedAuthenticatorData(ref data); + SetSecondaryAuthenticationData(ref data); } /// From 4167b76b6d3c77c9e82e1b7832829a3cdd493501 Mon Sep 17 00:00:00 2001 From: Krzysztof Nozderko Date: Wed, 29 Jan 2025 10:51:01 +0100 Subject: [PATCH 2/2] SNOW-715504 Add attribution note (#1088) --- .../Infrastructure/SFCredentialManagerWindowsNativeImpl.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Snowflake.Data/Core/CredentialManager/Infrastructure/SFCredentialManagerWindowsNativeImpl.cs b/Snowflake.Data/Core/CredentialManager/Infrastructure/SFCredentialManagerWindowsNativeImpl.cs index 5e8819b9b..fb7dfd402 100644 --- a/Snowflake.Data/Core/CredentialManager/Infrastructure/SFCredentialManagerWindowsNativeImpl.cs +++ b/Snowflake.Data/Core/CredentialManager/Infrastructure/SFCredentialManagerWindowsNativeImpl.cs @@ -110,6 +110,7 @@ public void SaveCredentials(string key, string token) } } + // note: the code below of dealing with Advapi32.dll library was inspired by: https://github.com/AdysTech/CredentialManager [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private struct Credential {