Class CognitoCredentialsProvider.CognitoCredentialsProviderBuilder
java.lang.Object
software.amazon.awssdk.crt.auth.credentials.CognitoCredentialsProvider.CognitoCredentialsProviderBuilder
- Enclosing class:
- CognitoCredentialsProvider
A builder class for the Cognito provider and its options
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a new Cognito credentials provider, based on this builder's configurationwithClientBootstrap(ClientBootstrap clientBootstrap) (Optional) Sets the client bootstrap (host resolver and event loop group) to use when making the connections required by this provider.withCustomRoleArn(String customRoleArn) (optional) Sets the ARN of the role to be assumed when multiple roles were received in the token from the identity provider.withEndpoint(String endpoint) Sets the Cognito service endpoint to use when sourcing credentials via HTTPwithHttpProxyOptions(HttpProxyOptions httpProxyOptions) Sets the proxy configuration to use when making the http request that fetches session credentials from the AWS Cognito Identity servicewithIdentity(String identity) Sets the Cognito identity to source credentials forAdds an identity provider token pair to allow for authenticated identity access.withLoginTokenSource(CognitoLoginTokenSource loginTokenSource) Sets a login token source for the credentials provider.withTlsContext(TlsContext tlsContext) Sets the tls context to use when making HTTP requests to the Cognito Identity service
-
Constructor Details
-
CognitoCredentialsProviderBuilder
public CognitoCredentialsProviderBuilder()Default constructor
-
-
Method Details
-
withEndpoint
Sets the Cognito service endpoint to use when sourcing credentials via HTTP- Parameters:
endpoint- cognito service endpoint to use- Returns:
- The current builder
-
getEndpoint
-
withIdentity
Sets the Cognito identity to source credentials for- Parameters:
identity- the cognito identity to source credentials for- Returns:
- The current builder
-
getIdentity
-
withCustomRoleArn
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withCustomRoleArn(String customRoleArn) (optional) Sets the ARN of the role to be assumed when multiple roles were received in the token from the identity provider.- Parameters:
customRoleArn- ARN of the role to be assumed when multiple roles were received in the token from the identity provider- Returns:
- The current builder
-
getCustomRoleArn
-
withLogin
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withLogin(CognitoCredentialsProvider.CognitoLoginTokenPair login) Adds an identity provider token pair to allow for authenticated identity access.- Parameters:
login- identity provider token pair- Returns:
- The current builder
-
getLogins
-
withClientBootstrap
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withClientBootstrap(ClientBootstrap clientBootstrap) (Optional) Sets the client bootstrap (host resolver and event loop group) to use when making the connections required by this provider.- Parameters:
clientBootstrap- client bootstrap to use- Returns:
- The current builder
-
withTlsContext
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withTlsContext(TlsContext tlsContext) Sets the tls context to use when making HTTP requests to the Cognito Identity service- Parameters:
tlsContext- the tls context to use when making HTTP requests- Returns:
- The current builder
-
withHttpProxyOptions
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withHttpProxyOptions(HttpProxyOptions httpProxyOptions) Sets the proxy configuration to use when making the http request that fetches session credentials from the AWS Cognito Identity service- Parameters:
httpProxyOptions- proxy configuration for the credentials fetching http request- Returns:
- The current builder
-
withLoginTokenSource
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withLoginTokenSource(CognitoLoginTokenSource loginTokenSource) Sets a login token source for the credentials provider. The login token source will be used to gather additional login tokens to submit as part of the HTTP request sent to Cognito. A login token source allows you to dynamically add login tokens on a per-request basis. Using a login token source requires you to follow certain requirements in order to avoid undesirable behavior. See the documentation for `CognitoLoginTokenSource` for further details.- Parameters:
loginTokenSource- object to source login tokens from before every HTTP request to Cognito- Returns:
- The current builder
-
build
Creates a new Cognito credentials provider, based on this builder's configuration- Returns:
- a new Cognito credentials provider
-