Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. AWSMobileClient auth = AWSMobileClient.getInstance();
  2. auth.signIn("username", "password", new HashMap<String, String>());
  3. if (auth.isSignedIn()) {
  4. ActivityUtils.startActivity(this, MyActivity.class);
  5. }
  6.  
  7. Role ARN arn:aws:iam::<my account number>:role/Cognito_S3_Full_Access
  8.  
  9. {
  10. "Version": "2012-10-17",
  11. "Statement": [
  12. {
  13. "Effect": "Allow",
  14. "Action": "s3:*",
  15. "Resource": "*"
  16. }
  17. ]
  18. }
  19.  
  20. AWSMobileClient awsMobileClient =AWSMobileClient.getInstance();
  21. AmazonS3Client s3Client = new AmazonS3Client(awsMobileClient);
  22.  
  23. 2019-05-20 17:56:21.645 27019-27019/com.mycomp.mypackage E/S3Uploader: Error upload file to S3 bucket : Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 375C07384A904483)
  24.  
  25. BasicAWSCredentials credentials = new BasicAWSCredentials("myAccessKey_hsjgfhjsdg", "mySecretKey_asdhasjkdha");
  26. AmazonS3Client s3Client = new AmazonS3Client(credentials);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement