Skip to content
v2.278.0

IdentityPoolProps Struct ​

Props for the Identity Pool construct.

Example ​

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
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
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();
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"
    }
});
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 ​

allowClassicFlowoptionalbooleanallow_classic_flowoptionalboolallowClassicFlowoptionalBooleanAllowClassicFlowoptionalboolAllowClassicFlowoptional*bool #
Enables the Basic (Classic) authentication flow.

Default: Classic Flow not allowed

allowUnauthenticatedIdentitiesoptionalbooleanallow_unauthenticated_identitiesoptionalboolallowUnauthenticatedIdentitiesoptionalBooleanAllowUnauthenticatedIdentitiesoptionalboolAllowUnauthenticatedIdentitiesoptional*bool = false #
Whether the Identity Pool supports unauthenticated logins.
authenticatedRoleoptionalIRoleauthenticated_roleoptionalIRoleauthenticatedRoleoptionalIRoleAuthenticatedRoleoptionalIRoleAuthenticatedRoleoptionalIRole #
The default Role to be assumed by authenticated users.

Default: A default authenticated Role will be added

authenticationProvidersoptionalIdentityPoolAuthenticationProvidersauthentication_providersoptionalIdentityPoolAuthenticationProvidersauthenticationProvidersoptionalIdentityPoolAuthenticationProvidersAuthenticationProvidersoptionalIdentityPoolAuthenticationProvidersAuthenticationProvidersoptionalIdentityPoolAuthenticationProviders #
Authentication Providers for using in Identity Pool.

Default: No Authentication Providers passed directly to Identity Pool

identityPoolNameoptionalstringidentity_pool_nameoptionalstridentityPoolNameoptionalStringIdentityPoolNameoptionalstringIdentityPoolNameoptional*string #
The name of the Identity Pool.

Default: Automatically generated name by CloudFormation at deploy time

roleMappingsoptionalIdentityPoolRoleMapping[]role_mappingsoptionaltyping.List[IdentityPoolRoleMapping]roleMappingsoptionalList<IdentityPoolRoleMapping>RoleMappingsoptionalIdentityPoolRoleMapping[]RoleMappingsoptional*[]IdentityPoolRoleMapping #
Rules for mapping roles to users.

Default: no role mappings

unauthenticatedRoleoptionalIRoleunauthenticated_roleoptionalIRoleunauthenticatedRoleoptionalIRoleUnauthenticatedRoleoptionalIRoleUnauthenticatedRoleoptionalIRole #
The default Role to be assumed by unauthenticated users.

Default: A default unauthenticated Role will be added