Class UserPoolClientProps.Builder
java.lang.Object
software.amazon.awscdk.services.cognito.UserPoolClientProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<UserPoolClientProps>
- Enclosing interface:
UserPoolClientProps
@Stability(Stable)
public static final class UserPoolClientProps.Builder
extends Object
implements software.amazon.jsii.Builder<UserPoolClientProps>
A builder for
UserPoolClientProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessTokenValidity(Duration accessTokenValidity) Sets the value ofUserPoolClientOptions.getAccessTokenValidity()analytics(AnalyticsConfiguration analytics) Sets the value ofUserPoolClientOptions.getAnalytics()Sets the value ofUserPoolClientOptions.getAuthFlows()authSessionValidity(Duration authSessionValidity) Sets the value ofUserPoolClientOptions.getAuthSessionValidity()build()Builds the configured instance.disableOAuth(Boolean disableOAuth) Sets the value ofUserPoolClientOptions.getDisableOAuth()enablePropagateAdditionalUserContextData(Boolean enablePropagateAdditionalUserContextData) Sets the value ofUserPoolClientOptions.getEnablePropagateAdditionalUserContextData()enableTokenRevocation(Boolean enableTokenRevocation) Sets the value ofUserPoolClientOptions.getEnableTokenRevocation()generateSecret(Boolean generateSecret) Sets the value ofUserPoolClientOptions.getGenerateSecret()idTokenValidity(Duration idTokenValidity) Sets the value ofUserPoolClientOptions.getIdTokenValidity()oAuth(OAuthSettings oAuth) Sets the value ofUserPoolClientOptions.getOAuth()preventUserExistenceErrors(Boolean preventUserExistenceErrors) Sets the value ofUserPoolClientOptions.getPreventUserExistenceErrors()readAttributes(ClientAttributes readAttributes) Sets the value ofUserPoolClientOptions.getReadAttributes()refreshTokenRotationGracePeriod(Duration refreshTokenRotationGracePeriod) Sets the value ofUserPoolClientOptions.getRefreshTokenRotationGracePeriod()refreshTokenValidity(Duration refreshTokenValidity) Sets the value ofUserPoolClientOptions.getRefreshTokenValidity()supportedIdentityProviders(List<? extends UserPoolClientIdentityProvider> supportedIdentityProviders) Sets the value ofUserPoolClientOptions.getSupportedIdentityProviders()Sets the value ofUserPoolClientProps.getUserPool()userPoolClientName(String userPoolClientName) Sets the value ofUserPoolClientOptions.getUserPoolClientName()writeAttributes(ClientAttributes writeAttributes) Sets the value ofUserPoolClientOptions.getWriteAttributes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
userPool
Sets the value ofUserPoolClientProps.getUserPool()- Parameters:
userPool- The UserPool resource this client will have access to. This parameter is required.- Returns:
this
-
accessTokenValidity
@Stability(Stable) public UserPoolClientProps.Builder accessTokenValidity(Duration accessTokenValidity) Sets the value ofUserPoolClientOptions.getAccessTokenValidity()- Parameters:
accessTokenValidity- 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.- Returns:
this
-
analytics
Sets the value ofUserPoolClientOptions.getAnalytics()- Parameters:
analytics- The analytics configuration for this client.- Returns:
this
-
authFlows
Sets the value ofUserPoolClientOptions.getAuthFlows()- Parameters:
authFlows- The set of OAuth authentication flows to enable on the client.- Returns:
this
-
authSessionValidity
@Stability(Stable) public UserPoolClientProps.Builder authSessionValidity(Duration authSessionValidity) Sets the value ofUserPoolClientOptions.getAuthSessionValidity()- Parameters:
authSessionValidity- 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 inAuthSessionValidity. Valid duration is from 3 to 15 minutes.- Returns:
this
-
disableOAuth
Sets the value ofUserPoolClientOptions.getDisableOAuth()- Parameters:
disableOAuth- Turns off all OAuth interactions for this client.- Returns:
this
-
enablePropagateAdditionalUserContextData
@Stability(Stable) public UserPoolClientProps.Builder enablePropagateAdditionalUserContextData(Boolean enablePropagateAdditionalUserContextData) Sets the value ofUserPoolClientOptions.getEnablePropagateAdditionalUserContextData()- Parameters:
enablePropagateAdditionalUserContextData- Enable the propagation of additional user context data. You can only activate enablePropagateAdditionalUserContextData in an app client that has a client secret.- Returns:
this
-
enableTokenRevocation
@Stability(Stable) public UserPoolClientProps.Builder enableTokenRevocation(Boolean enableTokenRevocation) Sets the value ofUserPoolClientOptions.getEnableTokenRevocation()- Parameters:
enableTokenRevocation- Enable token revocation for this client.- Returns:
this
-
generateSecret
Sets the value ofUserPoolClientOptions.getGenerateSecret()- Parameters:
generateSecret- Whether to generate a client secret.- Returns:
this
-
idTokenValidity
Sets the value ofUserPoolClientOptions.getIdTokenValidity()- Parameters:
idTokenValidity- 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.- Returns:
this
-
oAuth
Sets the value ofUserPoolClientOptions.getOAuth()- Parameters:
oAuth- OAuth settings for this client to interact with the app. An error is thrown when this is specified anddisableOAuthis set.- Returns:
this
-
preventUserExistenceErrors
@Stability(Stable) public UserPoolClientProps.Builder preventUserExistenceErrors(Boolean preventUserExistenceErrors) Sets the value ofUserPoolClientOptions.getPreventUserExistenceErrors()- Parameters:
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.- Returns:
this
-
readAttributes
@Stability(Stable) public UserPoolClientProps.Builder readAttributes(ClientAttributes readAttributes) Sets the value ofUserPoolClientOptions.getReadAttributes()- Parameters:
readAttributes- The set of attributes this client will be able to read.- Returns:
this
-
refreshTokenRotationGracePeriod
@Stability(Stable) public UserPoolClientProps.Builder refreshTokenRotationGracePeriod(Duration refreshTokenRotationGracePeriod) Sets the value ofUserPoolClientOptions.getRefreshTokenRotationGracePeriod()- Parameters:
refreshTokenRotationGracePeriod- Enables refresh token rotation when set. Defines the grace period for the original refresh token (0-60 seconds).- Returns:
this
-
refreshTokenValidity
@Stability(Stable) public UserPoolClientProps.Builder refreshTokenValidity(Duration refreshTokenValidity) Sets the value ofUserPoolClientOptions.getRefreshTokenValidity()- Parameters:
refreshTokenValidity- Validity of the refresh token. Values between 60 minutes and 10 years are valid.- Returns:
this
-
supportedIdentityProviders
@Stability(Stable) public UserPoolClientProps.Builder supportedIdentityProviders(List<? extends UserPoolClientIdentityProvider> supportedIdentityProviders) Sets the value ofUserPoolClientOptions.getSupportedIdentityProviders()- Parameters:
supportedIdentityProviders- The list of identity providers that users should be able to use to sign in using this client.- Returns:
this
-
userPoolClientName
Sets the value ofUserPoolClientOptions.getUserPoolClientName()- Parameters:
userPoolClientName- Name of the application client.- Returns:
this
-
writeAttributes
@Stability(Stable) public UserPoolClientProps.Builder writeAttributes(ClientAttributes writeAttributes) Sets the value ofUserPoolClientOptions.getWriteAttributes()- Parameters:
writeAttributes- The set of attributes this client will be able to write.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<UserPoolClientProps>- Returns:
- a new instance of
UserPoolClientProps - Throws:
NullPointerException- if any required attribute was not provided
-