createCredentialProvider
public static CredentialsProvider createCredentialProvider(String secretName,
CachableSecretsManager secretsManager,
InitializableCredentialsProvider provider)
Creates a credentials provider based on the secret configuration.
If OAuth is configured (determined by the provider's isOAuthConfigured method), creates an instance
of the specified OAuth provider. Otherwise, creates a default username/password credentials provider.
- Parameters:
secretName - The name of the secret in AWS Secrets Manager
secretsManager - The secrets manager instance
provider - The InitializableCredentialsProvider instance to check and initialize
- Returns:
- A new CredentialsProvider instance based on the secret configuration
- Throws:
AthenaConnectorException - if there are errors deserializing the secret or creating the provider