Class SnowflakeCredentialsProvider

  • All Implemented Interfaces:
    CredentialsProvider

    public class SnowflakeCredentialsProvider
    extends Object
    implements CredentialsProvider
    Snowflake credentials provider that manages multiple authentication methods. This provider handles OAuth token lifecycle, key-pair authentication, and password authentication. Authentication method is automatically determined based on the secret contents.
    • Constructor Detail

      • SnowflakeCredentialsProvider

        public SnowflakeCredentialsProvider​(String oauthSecretName)
      • SnowflakeCredentialsProvider

        public SnowflakeCredentialsProvider​(String oauthSecretName,
                                            software.amazon.awssdk.services.secretsmanager.SecretsManagerClient secretsClient)
    • Method Detail

      • getCredentialMap

        public Map<String,​String> getCredentialMap()
        Description copied from interface: CredentialsProvider
        Retrieves credential properties as a map for database connection. Default Behavior: The default implementation returns a map containing only the basic "user" and "password" properties extracted from the DefaultCredentials object returned by CredentialsProvider.getCredential(). This maintains backward compatibility with existing JDBC connection patterns. Extended Behavior: Implementations can override this method to provide additional connection properties beyond just username and password. This enables support for advanced authentication mechanisms. Usage: The returned map is directly applied to JDBC connection properties, allowing for seamless integration with various database drivers and authentication schemes without requiring custom connection factory implementations.
        Specified by:
        getCredentialMap in interface CredentialsProvider
        Returns:
        Map containing credential properties for database connection. The default implementation returns a map with "user" and "password" keys. Overriding implementations may return additional properties as needed for their specific authentication requirements.