/** * Constructs a new CognitoCredentialsProvider, which will set up a link to * the provider passed in using the enhanced authentication flow to get * short-lived credentials from Amazon Cognito, which can be retrieved from * {@link #getCredentials()} * <p> * This version of the constructor allows you to specify your own Identity * Provider class and the Amazon Cognito client. * </p> * * @param provider a reference to the provider in question, including what's * needed to interact with it to later connect with Amazon * Cognito * @param cibClient Preconfigured CognitoIdentity client to make requests * with */ public CognitoCredentialsProvider(AWSCognitoIdentityProvider provider, AmazonCognitoIdentityClient cibClient) { this.cib = cibClient; this.region = cibClient.getRegions().getName(); this.identityProvider = provider; this.unauthRoleArn = null; this.authRoleArn = null; this.securityTokenService = null; this.sessionDuration = DEFAULT_DURATION_SECONDS; this.refreshThreshold = DEFAULT_THRESHOLD_SECONDS; this.useEnhancedFlow = true; this.credentialsLock = new ReentrantReadWriteLock(true); }
this.region = cibClient.getRegions().getName(); this.securityTokenService = stsClient;
/** * Constructs a new CognitoCredentialsProvider, which will set up a link to * the provider passed in using the enhanced authentication flow to get * short-lived credentials from Amazon Cognito, which can be retrieved from * {@link #getCredentials()} * <p> * This version of the constructor allows you to specify your own Identity * Provider class and the Amazon Cognito client. * </p> * * @param provider a reference to the provider in question, including what's * needed to interact with it to later connect with Amazon * Cognito * @param cibClient Preconfigured CognitoIdentity client to make requests * with */ public CognitoCredentialsProvider(AWSCognitoIdentityProvider provider, AmazonCognitoIdentityClient cibClient) { this.cib = cibClient; this.region = cibClient.getRegions().getName(); this.identityProvider = provider; this.unauthRoleArn = null; this.authRoleArn = null; this.securityTokenService = null; this.sessionDuration = DEFAULT_DURATION_SECONDS; this.refreshThreshold = DEFAULT_THRESHOLD_SECONDS; this.useEnhancedFlow = true; this.credentialsLock = new ReentrantReadWriteLock(true); }
this.region = cibClient.getRegions().getName(); this.securityTokenService = stsClient;