# ClientPasswordAuthType

Client password authentication type used by a proxy to log in as a specific database user.

- Source: [`aws-rds/lib/proxy.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-rds/lib/proxy.ts#L23)
- Type last changed: v2.215.0 · 15 Sep 2025

## Example

TypeScript:

```ts
declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({
    version: rds.AuroraMysqlEngineVersion.VER_3_03_0,
  }),
  writer: rds.ClusterInstance.provisioned('writer'),
  vpc,
});

const proxy = new rds.DatabaseProxy(this, 'Proxy', {
  proxyTarget: rds.ProxyTarget.fromCluster(cluster),
  secrets: [cluster.secret!],
  vpc,
  clientPasswordAuthType: rds.ClientPasswordAuthType.MYSQL_NATIVE_PASSWORD,
});
```

Python:

```python
# vpc: ec2.Vpc

cluster = rds.DatabaseCluster(self, "Database",
    engine=rds.DatabaseClusterEngine.aurora_mysql(
        version=rds.AuroraMysqlEngineVersion.VER_3_03_0
    ),
    writer=rds.ClusterInstance.provisioned("writer"),
    vpc=vpc
)

proxy = rds.DatabaseProxy(self, "Proxy",
    proxy_target=rds.ProxyTarget.from_cluster(cluster),
    secrets=[cluster.secret],
    vpc=vpc,
    client_password_auth_type=rds.ClientPasswordAuthType.MYSQL_NATIVE_PASSWORD
)
```

Java:

```java
Vpc vpc;

DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database")
        .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder()
                .version(AuroraMysqlEngineVersion.VER_3_03_0)
                .build()))
        .writer(ClusterInstance.provisioned("writer"))
        .vpc(vpc)
        .build();

DatabaseProxy proxy = DatabaseProxy.Builder.create(this, "Proxy")
        .proxyTarget(ProxyTarget.fromCluster(cluster))
        .secrets(List.of(cluster.getSecret()))
        .vpc(vpc)
        .clientPasswordAuthType(ClientPasswordAuthType.MYSQL_NATIVE_PASSWORD)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;

var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
    Engine = DatabaseClusterEngine.AuroraMysql(new AuroraMysqlClusterEngineProps {
        Version = AuroraMysqlEngineVersion.VER_3_03_0
    }),
    Writer = ClusterInstance.Provisioned("writer"),
    Vpc = vpc
});

var proxy = new DatabaseProxy(this, "Proxy", new DatabaseProxyProps {
    ProxyTarget = ProxyTarget.FromCluster(cluster),
    Secrets = new [] { cluster.Secret },
    Vpc = vpc,
    ClientPasswordAuthType = ClientPasswordAuthType.MYSQL_NATIVE_PASSWORD
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc

cluster := rds.NewDatabaseCluster(this, jsii.String("Database"), &DatabaseClusterProps{
	Engine: rds.DatabaseClusterEngine_AuroraMysql(&AuroraMysqlClusterEngineProps{
		Version: rds.AuroraMysqlEngineVersion_VER_3_03_0(),
	}),
	Writer: rds.ClusterInstance_Provisioned(jsii.String("writer")),
	Vpc: Vpc,
})

proxy := rds.NewDatabaseProxy(this, jsii.String("Proxy"), &DatabaseProxyProps{
	ProxyTarget: rds.ProxyTarget_FromCluster(cluster),
	Secrets: []ISecret{
		cluster.Secret,
	},
	Vpc: Vpc,
	ClientPasswordAuthType: rds.ClientPasswordAuthType_MYSQL_NATIVE_PASSWORD,
})
```

## Members

| Member | Description |
| --- | --- |
| `MYSQL_NATIVE_PASSWORD` | MySQL Native Password client authentication type. |
| `POSTGRES_SCRAM_SHA_256` | SCRAM SHA 256 client authentication type. |
| `POSTGRES_MD5` | PostgreSQL MD5 client authentication type. |
| `SQL_SERVER_AUTHENTICATION` | SQL Server Authentication client authentication type. |
| `MYSQL_CACHING_SHA2_PASSWORD` | MySQL Caching SHA2 Password client authentication type. |

## Referenced by

- [`DatabaseProxyOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseProxyOptions.html).clientPasswordAuthType
