# IdentityPoolProps

Props for the Identity Pool construct.

Used as props by: [IdentityPool](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito_identitypool.IdentityPool.html)

- Source: [`aws-cognito-identitypool/lib/identitypool.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cognito-identitypool/lib/identitypool.ts#L42)
- Type last changed: v2.186.0 · 27 Mar 2025

## Example

TypeScript:

```ts
declare const openIdConnectProvider: iam.OpenIdConnectProvider;
new IdentityPool(this, 'myidentitypool', {
  identityPoolName: 'myidentitypool',
  authenticationProviders: {
    google: {
      clientId: '12345678012.apps.googleusercontent.com',
    },
    openIdConnectProviders: [openIdConnectProvider],
    customProvider: 'my-custom-provider.example.com',
  },
});
```

Python:

```python
from aws_cdk.aws_cognito_identitypool import IdentityPoolAuthenticationProviders, IdentityPoolGoogleLoginProvider
# open_id_connect_provider: iam.OpenIdConnectProvider

IdentityPool(self, "myidentitypool",
    identity_pool_name="myidentitypool",
    authentication_providers=IdentityPoolAuthenticationProviders(
        google=IdentityPoolGoogleLoginProvider(
            client_id="12345678012.apps.googleusercontent.com"
        ),
        open_id_connect_providers=[open_id_connect_provider],
        custom_provider="my-custom-provider.example.com"
    )
)
```

Java:

```java
OpenIdConnectProvider openIdConnectProvider;

IdentityPool.Builder.create(this, "myidentitypool")
        .identityPoolName("myidentitypool")
        .authenticationProviders(IdentityPoolAuthenticationProviders.builder()
                .google(IdentityPoolGoogleLoginProvider.builder()
                        .clientId("12345678012.apps.googleusercontent.com")
                        .build())
                .openIdConnectProviders(List.of(openIdConnectProvider))
                .customProvider("my-custom-provider.example.com")
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
OpenIdConnectProvider openIdConnectProvider;

new IdentityPool(this, "myidentitypool", new IdentityPoolProps {
    IdentityPoolName = "myidentitypool",
    AuthenticationProviders = new IdentityPoolAuthenticationProviders {
        Google = new IdentityPoolGoogleLoginProvider {
            ClientId = "12345678012.apps.googleusercontent.com"
        },
        OpenIdConnectProviders = new [] { openIdConnectProvider },
        CustomProvider = "my-custom-provider.example.com"
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var openIdConnectProvider OpenIdConnectProvider

awscdk.NewIdentityPool(this, jsii.String("myidentitypool"), &IdentityPoolProps{
	IdentityPoolName: jsii.String("myidentitypool"),
	AuthenticationProviders: &IdentityPoolAuthenticationProviders{
		Google: &IdentityPoolGoogleLoginProvider{
			ClientId: jsii.String("12345678012.apps.googleusercontent.com"),
		},
		OpenIdConnectProviders: []IOIDCProviderRef{
			openIdConnectProvider,
		},
		CustomProvider: jsii.String("my-custom-provider.example.com"),
	},
})
```

## Properties

- `allowClassicFlow`: boolean — Enables the Basic (Classic) authentication flow.

  **Default:** Classic Flow not allowed

- `allowUnauthenticatedIdentities`: boolean = false — Whether the Identity Pool supports unauthenticated logins.

- `authenticatedRole`: [IRole](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The default Role to be assumed by authenticated users.

  **Default:** A default authenticated Role will be added

- `authenticationProviders`: [IdentityPoolAuthenticationProviders](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito_identitypool.IdentityPoolAuthenticationProviders.html) — Authentication Providers for using in Identity Pool.

  **Default:** No Authentication Providers passed directly to Identity Pool

- `identityPoolName`: string — The name of the Identity Pool.

  **Default:** Automatically generated name by CloudFormation at deploy time

- `roleMappings`: [IdentityPoolRoleMapping](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito_identitypool.IdentityPoolRoleMapping.html)[] — Rules for mapping roles to users.

  **Default:** no role mappings

- `unauthenticatedRole`: [IRole](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The default Role to be assumed by unauthenticated users.

  **Default:** A default unauthenticated Role will be added
