Class UserPoolClientOptions
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)
AuthFlows
The set of OAuth authentication flows to enable on the client.
public IAuthFlow? AuthFlows { get; set; }
Property Value
Remarks
Default: - all auth flows disabled
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
Default: true for new user pool clients
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)
OAuth
OAuth settings for this client to interact with the app.
public IOAuthSettings? OAuth { get; set; }
Property Value
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
Default: false
See: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-managing-errors.html
ReadAttributes
The set of attributes this client will be able to read.
public ClientAttributes? ReadAttributes { get; set; }
Property Value
Remarks
Default: - all standard and custom attributes
RefreshTokenValidity
Validity of the refresh token.
public Duration? RefreshTokenValidity { get; set; }
Property Value
- Duration
Remarks
Values between 60 minutes and 10 years are valid.
Default: Duration.days(30)
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
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
Remarks
Default: - cloudformation generated name
WriteAttributes
The set of attributes this client will be able to write.
public ClientAttributes? WriteAttributes { get; set; }
Property Value
Remarks
Default: - all standard and custom attributes