Table of Contents

Class UserPoolClientOptions

Namespace
Amazon.CDK.AWS.Cognito
Assembly
Amazon.CDK.AWS.Cognito.dll

Options to create a UserPoolClient.

public class UserPoolClientOptions : IUserPoolClientOptions
Inheritance
UserPoolClientOptions
Implements
Inherited Members

Examples

var pool = new UserPool(this, "Pool");
            pool.AddClient("app-client", new UserPoolClientOptions {
                OAuth = new OAuthSettings {
                    Flows = new OAuthFlows {
                        AuthorizationCodeGrant = true
                    },
                    Scopes = new [] { OAuthScope.OPENID },
                    CallbackUrls = new [] { "https://my-app-domain.com/welcome" },
                    LogoutUrls = new [] { "https://my-app-domain.com/signin" }
                }
            });

Remarks

ExampleMetadata: infused

Constructors

UserPoolClientOptions()

public UserPoolClientOptions()

Properties

AccessTokenValidity

Validity of the access token.

public Duration? AccessTokenValidity { get; set; }

Property Value

Duration

Remarks

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

Default: Duration.minutes(60)

See: https://docs.aws.amazon.com/en_us/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html#amazon-cognito-user-pools-using-the-access-token

AuthFlows

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

public IAuthFlow? AuthFlows { get; set; }

Property Value

IAuthFlow

Remarks

DisableOAuth

Turns off all OAuth interactions for this client.

public bool? DisableOAuth { get; set; }

Property Value

bool?

Remarks

Default: false

EnableTokenRevocation

Enable token revocation for this client.

public bool? EnableTokenRevocation { get; set; }

Property Value

bool?

Remarks

GenerateSecret

Whether to generate a client secret.

public bool? GenerateSecret { get; set; }

Property Value

bool?

Remarks

Default: false

IdTokenValidity

Validity of the ID token.

public Duration? IdTokenValidity { get; set; }

Property Value

Duration

Remarks

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

Default: Duration.minutes(60)

See: https://docs.aws.amazon.com/en_us/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html#amazon-cognito-user-pools-using-the-id-token

OAuth

OAuth settings for this client to interact with the app.

public IOAuthSettings? OAuth { get; set; }

Property Value

IOAuthSettings

Remarks

An error is thrown when this is specified and disableOAuth is set.

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

PreventUserExistenceErrors

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.

public bool? PreventUserExistenceErrors { get; set; }

Property Value

bool?

Remarks

ReadAttributes

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

public ClientAttributes? ReadAttributes { get; set; }

Property Value

ClientAttributes

Remarks

RefreshTokenValidity

Validity of the refresh token.

public Duration? RefreshTokenValidity { get; set; }

Property Value

Duration

Remarks

SupportedIdentityProviders

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

public UserPoolClientIdentityProvider[]? SupportedIdentityProviders { get; set; }

Property Value

UserPoolClientIdentityProvider[]

Remarks

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.

UserPoolClientName

Name of the application client.

public string? UserPoolClientName { get; set; }

Property Value

string

Remarks

Default: - cloudformation generated name

WriteAttributes

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

public ClientAttributes? WriteAttributes { get; set; }

Property Value

ClientAttributes

Remarks