Class UserPoolClientOptions.Builder
java.lang.Object
software.amazon.awscdk.services.cognito.UserPoolClientOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<UserPoolClientOptions>
- Enclosing interface:
UserPoolClientOptions
@Stability(Stable)
public static final class UserPoolClientOptions.Builder
extends Object
implements software.amazon.jsii.Builder<UserPoolClientOptions>
A builder for
UserPoolClientOptions
-
Constructor Summary
-
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()
userPoolClientName
(String userPoolClientName) Sets the value ofUserPoolClientOptions.getUserPoolClientName()
writeAttributes
(ClientAttributes writeAttributes) Sets the value ofUserPoolClientOptions.getWriteAttributes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
accessTokenValidity
@Stability(Stable) public UserPoolClientOptions.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 UserPoolClientOptions.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 anddisableOAuth
is set.- Returns:
this
-
preventUserExistenceErrors
@Stability(Stable) public UserPoolClientOptions.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 UserPoolClientOptions.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 UserPoolClientOptions.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 UserPoolClientOptions.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
@Stability(Stable) public UserPoolClientOptions.Builder userPoolClientName(String userPoolClientName) Sets the value ofUserPoolClientOptions.getUserPoolClientName()
- Parameters:
userPoolClientName
- Name of the application client.- Returns:
this
-
writeAttributes
@Stability(Stable) public UserPoolClientOptions.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:
build
in interfacesoftware.amazon.jsii.Builder<UserPoolClientOptions>
- Returns:
- a new instance of
UserPoolClientOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-