Class CognitoCredentialsProvider.CognitoCredentialsProviderBuilder
- java.lang.Object
-
- software.amazon.awssdk.crt.auth.credentials.CognitoCredentialsProvider.CognitoCredentialsProviderBuilder
-
- Enclosing class:
- CognitoCredentialsProvider
public static class CognitoCredentialsProvider.CognitoCredentialsProviderBuilder extends Object
A builder class for the Cognito provider and its options
-
-
Constructor Summary
Constructors Constructor Description CognitoCredentialsProviderBuilder()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CognitoCredentialsProviderbuild()Creates a new Cognito credentials provider, based on this builder's configurationStringgetCustomRoleArn()StringgetEndpoint()StringgetIdentity()ArrayList<CognitoCredentialsProvider.CognitoLoginTokenPair>getLogins()CognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithClientBootstrap(ClientBootstrap clientBootstrap)(Optional) Sets the client bootstrap (host resolver and event loop group) to use when making the connections required by this provider.CognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithCustomRoleArn(String customRoleArn)(optional) Sets the ARN of the role to be assumed when multiple roles were received in the token from the identity provider.CognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithEndpoint(String endpoint)Sets the Cognito service endpoint to use when sourcing credentials via HTTPCognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithHttpProxyOptions(HttpProxyOptions httpProxyOptions)Sets the proxy configuration to use when making the http request that fetches session credentials from the AWS Cognito Identity serviceCognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithIdentity(String identity)Sets the Cognito identity to source credentials forCognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithLogin(CognitoCredentialsProvider.CognitoLoginTokenPair login)Adds an identity provider token pair to allow for authenticated identity access.CognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithLoginTokenSource(CognitoLoginTokenSource loginTokenSource)Sets a login token source for the credentials provider.CognitoCredentialsProvider.CognitoCredentialsProviderBuilderwithTlsContext(TlsContext tlsContext)Sets the tls context to use when making HTTP requests to the Cognito Identity service
-
-
-
Method Detail
-
withEndpoint
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withEndpoint(String endpoint)
Sets the Cognito service endpoint to use when sourcing credentials via HTTP- Parameters:
endpoint- cognito service endpoint to use- Returns:
- The current builder
-
getEndpoint
public String getEndpoint()
-
withIdentity
public CognitoCredentialsProvider.CognitoCredentialsProviderBuilder withIdentity(String identity)
Sets the Cognito identity to source credentials for- Parameters:
identity- the cognito identity to source credentials for- Returns:
- The current builder
-
getIdentity
public String 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
public String 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
public ArrayList<CognitoCredentialsProvider.CognitoLoginTokenPair> 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
public CognitoCredentialsProvider build()
Creates a new Cognito credentials provider, based on this builder's configuration- Returns:
- a new Cognito credentials provider
-
-