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()Sets the value ofUserPoolClientOptions.getAuthFlows()build()Builds the configured instance.disableOAuth(Boolean disableOAuth) Sets the value ofUserPoolClientOptions.getDisableOAuth()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()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
-
authFlows
Sets the value ofUserPoolClientOptions.getAuthFlows()- Parameters:
authFlows- The set of OAuth authentication flows to enable on the client.- Returns:
this
-
disableOAuth
Sets the value ofUserPoolClientOptions.getDisableOAuth()- Parameters:
disableOAuth- Turns off all OAuth interactions for this client.- 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
-
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
-