

# JWT
<a name="odbc-v2-driver-jwt"></a>

JWT（JSON Web 令牌）插件提供了一个使用 JSON Web 令牌担任 Amazon IAM 角色的接口。配置取决于身份提供商。有关为 Google Cloud 和 AWS 配置联合身份的信息，请参阅 Google Cloud 文档中的[使用 AWS 或 Azure 配置工作负载身份联合验证](https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds)。

## 身份验证类型
<a name="odbc-v2-driver-jwt-authentication-type"></a>


****  

| **连接字符串名称** | **参数类型** | **默认值** | **连接字符串示例** | 
| --- | --- | --- | --- | 
| AuthenticationType | 必需 | IAM Credentials | AuthenticationType=JWT; | 

## Preferred role
<a name="odbc-v2-driver-jwt-preferred-role"></a>

担任角色的 Amazon Resource Name（ARN）。有关 ARN 角色的更多信息，请参阅 *AWS Security Token Service API 参考*中的 [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)。


****  

| **连接字符串名称** | **参数类型** | **默认值** | **连接字符串示例** | 
| --- | --- | --- | --- | 
| preferred\$1role | 可选 | none | preferred\$1role=arn:aws:IAM::123456789012:id/user1; | 

## 会话持续时间
<a name="odbc-v2-driver-jwt-session-duration"></a>

角色会话的持续时间（以秒为单位）。有关会话持续时间的更多信息，请参阅 *AWS Security Token Service API 参考*中的 [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)。


****  

| **连接字符串名称** | **参数类型** | **默认值** | **连接字符串示例** | 
| --- | --- | --- | --- | 
| duration | 可选 | 900 | duration=900; | 

## JSON Web 令牌
<a name="odbc-v2-driver-jwt-json-web-token"></a>

用于使用 [AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) AWS STS API 操作检索 IAM 临时凭证的 JSON Web 令牌。有关为 Google Cloud Platform（GCP）用户生成 JSON Web 令牌的信息，请参阅 Google Cloud 文档中的[使用 JWT OAuth 令牌](https://cloud.google.com/apigee/docs/api-platform/security/oauth/using-jwt-oauth)。


****  

| **连接字符串名称** | **参数类型** | **默认值** | **连接字符串示例** | 
| --- | --- | --- | --- | 
| web\$1identity\$1token | 必需 | none | web\$1identity\$1token=eyJhbGc...<remainder of token>; | 

## 角色会话名称
<a name="odbc-v2-driver-jwt-role-session-name"></a>

会话的名称。常用方法是使用应用程序用户的名称或标识符作为角色会话名称。这样方便将应用程序使用的临时安全凭证与相应的用户相关联。


****  

| **连接字符串名称** | **参数类型** | **默认值** | **连接字符串示例** | 
| --- | --- | --- | --- | 
| role\$1session\$1name | 必需 | none | role\$1session\$1name=familiarname; | 