

# AWS configuration profile credentials

You can use credentials stored in an AWS configuration profile by setting the following connection parameters. AWS configuration profiles are typically stored in files in the `~/.aws` directory. For information about AWS configuration profiles, see [Use profiles](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-profiles.html) in the *AWS SDK for Java Developer Guide*.

## Credentials provider
<a name="jdbc-v4-driver-aws-configuration-profile-credentials-provider"></a>

The credentials provider that will be used to authenticate requests to AWS. Set the value of this parameter to `ProfileCredentials`.



| Parameter name | Alias | Parameter type | Default value | Value to use | 
| --- | --- | --- | --- | --- | 
| CredentialsProvider | AWSCredentialsProviderClass (deprecated) | Required | none | ProfileCredentials | 

## Profile name
<a name="jdbc-v4-driver-profile-name"></a>

The name of the AWS configuration profile whose credentials should be used to authenticate the request to Athena.



| Parameter name | Alias | Parameter type | Default value | 
| --- | --- | --- | --- | 
| ProfileName | none | Optional | none | 

## Authenticating with an IAM Identity Center profile
<a name="jdbc-v4-driver-identity-center-profile-example"></a>

Use an IAM Identity Center profile with the `ProfileCredentials` provider to authenticate requests to AWS. This approach uses SSO-managed credentials instead of long-term access keys. The following configuration file example shows entries in the `~/.aws/config` file.

```
[profile athena-idc]
sso_session = athena-idc-session
sso_account_id = 111122223333
sso_role_name = AthenaQueryRole
region = us-east-1

[sso-session athena-idc-session]
sso_start_url = https://example.awsapps.com/start
sso_region = us-east-1
sso_registration_scopes = sso:account:access
```

Before opening the JDBC connection, sign in to the profile. For example, use `aws sso login --profile athena-idc`. Then configure the JDBC connection with the following parameters.

```
CredentialsProvider=ProfileCredentials;
ProfileName=athena-idc;
Region=us-east-1;
```