/** * Construct a synchronous implementation of AmazonCognitoIdentity using the current builder configuration. * * @param params * Current builder configuration represented as a parameter object. * @return Fully configured implementation of AmazonCognitoIdentity. */ @Override protected AmazonCognitoIdentity build(AwsSyncClientParams params) { return new AmazonCognitoIdentityClient(params); }
/** * Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the * baseline for both Cognito and developer trusted identity providers. * Custom providers should not extend this class, but should extend * AWSAbstractCognitoDeveloperIdentityProvider * * @deprecated please use AWSAbstractCognitoIdentityProvider(String * accountId, String identityPoolId, ClientConfiguration * clientConfiguration, Regions region) instead. * @param accountId the accountId of the developer * @param identityPoolId the identityPoolId to be used * @param clientConfiguration the client configuration to be used by the * client */ @Deprecated public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * An extension of the AbstractCognitoProvider that is used to communicate * with Cognito. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ public AWSEnhancedCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * An extension of the AbstractCognitoProvider that is used to communicate * with Cognito. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ public AWSBasicCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * Wraps around the AbstractIdentityProvider to cover some back end code * that is consistent across all providers, utilizing the CIB client to * handle the identity management. * * @deprecated please use AWSAbstractCognitoDeveloperIdentityProvider(String * accountId, String identityPoolId, ClientConfiguration * clientConfiguration, Regions region) instead * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ @Deprecated public AWSAbstractCognitoDeveloperIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
private static AmazonCognitoIdentityClient createIdentityClient(ClientConfiguration clientConfiguration, final Regions region) { AmazonCognitoIdentityClient identityClient = new AmazonCognitoIdentityClient(new AnonymousAWSCredentials(), clientConfiguration); identityClient.setRegion(Region.getRegion(region)); return identityClient; }
/** * Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the * baseline for both Cognito and developer trusted identity providers. * Custom providers should not extend this class, but should extend * AWSAbstractCognitoDeveloperIdentityProvider * * @param accountId the accountId of the developer * @param identityPoolId the identityPoolId to be used * @param clientConfiguration the client configuration to be used by the * client * @param region the region cognito will use */ public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); this.cib.setRegion(Region.getRegion(region)); }
/** * Wraps around the AbstractIdentityProvider to cover some back end code * that is consistent across all providers, utilizing the CIB client to * handle the identity management. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created * @param region the region the cib client will use */ public AWSAbstractCognitoDeveloperIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); this.cib.setRegion(Region.getRegion(region)); }
/** * An extension of the AbstractCognitoProvider that is used to communicate * with Cognito. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ public AWSEnhancedCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * An extension of the AbstractCognitoProvider that is used to communicate * with Cognito. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ public AWSBasicCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * Wraps around the AbstractIdentityProvider to cover some back end code * that is consistent across all providers, utilizing the CIB client to * handle the identity management. * * @deprecated please use AWSAbstractCognitoDeveloperIdentityProvider(String * accountId, String identityPoolId, ClientConfiguration * clientConfiguration, Regions region) instead * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ @Deprecated public AWSAbstractCognitoDeveloperIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * An extension of the AbstractCognitoProvider that is used to communicate * with Cognito. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ public AWSBasicCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * An extension of the AbstractCognitoProvider that is used to communicate * with Cognito. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ public AWSEnhancedCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
/** * Wraps around the AbstractIdentityProvider to cover some back end code * that is consistent across all providers, utilizing the CIB client to * handle the identity management. * * @deprecated please use AWSAbstractCognitoDeveloperIdentityProvider(String * accountId, String identityPoolId, ClientConfiguration * clientConfiguration, Regions region) instead * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created */ @Deprecated public AWSAbstractCognitoDeveloperIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); }
String cognitoIdentityId = "your user's identity id"; String openIdToken = "open id token for the user created on backend"; Map<String,String> logins = new HashMap<>(); logins.put("cognito-identity.amazonaws.com", openIdToken); GetCredentialsForIdentityRequest getCredentialsRequest = new GetCredentialsForIdentityRequest() .withIdentityId(cognitoIdentityId) .withLogins(logins); AmazonCognitoIdentityClient cognitoIdentityClient = new AmazonCognitoIdentityClient(); GetCredentialsForIdentityResult getCredentialsResult = cognitoIdentityClient.getCredentialsForIdentity(getCredentialsRequest); Credentials credentials = getCredentialsResult.getCredentials(); AWSSessionCredentials sessionCredentials = new BasicSessionCredentials( credentials.getAccessKeyId(), credentials.getSecretKey(), credentials.getSessionToken() ); AmazonS3Client s3Client = new AmazonS3Client(sessionCredentials); ...
private static AmazonCognitoIdentityClient createIdentityClient(ClientConfiguration clientConfiguration, final Regions region) { AmazonCognitoIdentityClient identityClient = new AmazonCognitoIdentityClient(new AnonymousAWSCredentials(), clientConfiguration); identityClient.setRegion(Region.getRegion(region)); return identityClient; }
/** * Wraps around the AbstractIdentityProvider to cover some back end code * that is consistent across all providers, utilizing the CIB client to * handle the identity management. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created * @param region the region the cib client will use */ public AWSAbstractCognitoDeveloperIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); this.cib.setRegion(Region.getRegion(region)); }
/** * Wraps around the AbstractIdentityProvider to cover some back end code * that is consistent across all providers, utilizing the CIB client to * handle the identity management. * * @param accountId the account id of the developer * @param identityPoolId the identity pool id of the app/user in question * @param clientConfiguration the configuration to apply to service clients * created * @param region the region the cib client will use */ public AWSAbstractCognitoDeveloperIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); this.cib.setRegion(Region.getRegion(region)); }
/** * Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the * baseline for both Cognito and developer trusted identity providers. * Custom providers should not extend this class, but should extend * AWSAbstractCognitoDeveloperIdentityProvider * * @param accountId the accountId of the developer * @param identityPoolId the identityPoolId to be used * @param clientConfiguration the client configuration to be used by the * client * @param region the region cognito will use */ public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); this.cib.setRegion(Region.getRegion(region)); }
/** * Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the * baseline for both Cognito and developer trusted identity providers. * Custom providers should not extend this class, but should extend * AWSAbstractCognitoDeveloperIdentityProvider * * @param accountId the accountId of the developer * @param identityPoolId the identityPoolId to be used * @param clientConfiguration the client configuration to be used by the * client * @param region the region cognito will use */ public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region) { this(accountId, identityPoolId, new AmazonCognitoIdentityClient (new AnonymousAWSCredentials(), clientConfiguration)); this.cib.setRegion(Region.getRegion(region)); }