AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

UserPoolClient

Define a UserPool App Client.

Import

import { UserPoolClient } from 'aws-cdk-lib/aws-cognito';

Or use the module namespace:

import * as cognito from 'aws-cdk-lib/aws-cognito';
// cognito.UserPoolClient

Properties

Configuration passed to the constructor as UserPoolClientProps.

userPoolRequired
IUserPoolRef

The UserPool resource this client will have access to.

17 properties inherited from UserPoolClientOptions
accessTokenValidityOptionalinherited from UserPoolClientOptions
Duration

Validity of the access token. Values between 5 minutes and 1 day are valid. The duration can not be longer than the refresh token validity.

Default: Duration.minutes(60)

analyticsOptionalinherited from UserPoolClientOptions
AnalyticsConfiguration

The analytics configuration for this client.

Default: - no analytics configuration

authFlowsOptionalinherited from UserPoolClientOptions
AuthFlow

The set of OAuth authentication flows to enable on the client.

Default: - If you don't specify a value, your user client supports ALLOW_REFRESH_TOKEN_AUTH, ALLOW_USER_SRP_AUTH, and ALLOW_CUSTOM_AUTH.

authSessionValidityOptionalinherited from UserPoolClientOptions
Duration

Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. see defaults in `AuthSessionValidity`. Valid duration is from 3 to 15 minutes.

Default: - Duration.minutes(3)

disableOAuthOptionalinherited from UserPoolClientOptions
boolean

Turns off all OAuth interactions for this client.

Default: false

enablePropagateAdditionalUserContextDataOptionalinherited from UserPoolClientOptions
boolean

Enable the propagation of additional user context data. You can only activate enablePropagateAdditionalUserContextData in an app client that has a client secret.

Default: false for new user pool clients

enableTokenRevocationOptionalinherited from UserPoolClientOptions
boolean

Enable token revocation for this client.

Default: true for new user pool clients

generateSecretOptionalinherited from UserPoolClientOptions
boolean

Whether to generate a client secret.

Default: false

idTokenValidityOptionalinherited from UserPoolClientOptions
Duration

Validity of the ID token. Values between 5 minutes and 1 day are valid. The duration can not be longer than the refresh token validity.

Default: Duration.minutes(60)

oAuthOptionalinherited from UserPoolClientOptions
OAuthSettings

OAuth settings for this client to interact with the app. An error is thrown when this is specified and `disableOAuth` is set.

Default: - see defaults in `OAuthSettings`. meaningless if `disableOAuth` is set.

preventUserExistenceErrorsOptionalinherited from UserPoolClientOptions
boolean

Whether Cognito returns a UserNotFoundException exception when the user does not exist in the user pool (false), or whether it returns another type of error that doesn't reveal the user's absence.

Default: false

readAttributesOptionalinherited from UserPoolClientOptions
ClientAttributes

The set of attributes this client will be able to read.

Default: - all standard and custom attributes

refreshTokenRotationGracePeriodOptionalinherited from UserPoolClientOptions
Duration

Enables refresh token rotation when set. Defines the grace period for the original refresh token (0-60 seconds).

Default: - undefined (refresh token rotation is disabled)

refreshTokenValidityOptionalinherited from UserPoolClientOptions
Duration

Validity of the refresh token. Values between 60 minutes and 10 years are valid.

Default: Duration.days(30)

supportedIdentityProvidersOptionalinherited from UserPoolClientOptions
UserPoolClientIdentityProvider[]

The list of identity providers that users should be able to use to sign in using this client.

Default: - supports all identity providers that are registered with the user pool. If the user pool and/or identity providers are imported, either specify this option explicitly or ensure that the identity providers are registered with the user pool using the `UserPool.registerIdentityProvider()` API.

userPoolClientNameOptionalinherited from UserPoolClientOptions
string

Name of the application client.

Default: - cloudformation generated name

writeAttributesOptionalinherited from UserPoolClientOptions
ClientAttributes

The set of attributes this client will be able to write.

Default: - all standard and custom attributes

Get the Amazon Cognito Cheat Sheet

Everything you need to know about Amazon Cognito on one page. HD quality, print-friendly.

Download Free Infographic