简体   繁体   English

适用于Android的AWS S3正确凭证集成

[英]AWS S3 correct credentials integration for Android

According to the official documentation , in order to use the s3 service for the AWS SDK on Android, it's mandatory to provide the Account Credentials through Cognito. 根据官方文档 ,为了将s3服务用于Android上的AWS开发工具包,必须通过Cognito提供帐户凭据。 However, in my organization, we do not use that service. 但是,在我的组织中,我们不使用该服务。

Is this the only proper way to connect to the service and integrate to my android app? 这是连接到服务并集成到我的android应用程序的唯一正确方法吗? I only have the information of the Token such as follows: 我只有令牌的信息,如下所示:

('AWS_S3_REGION', 'sa-east-1'); 
('AWS_S3_ACCESS_KEY', 'MYHAPPYKEY'); 
('AWS_S3_SECRET', 'xyz/MYHAPPYSECRET'); 
('AWS_S3_BUCKET', 'my.happy.bucket'); 
('AWS_S3_BUCKET_SUFFIX', '.dev');

Well, It seems that I could use the BasicAWSCredentials object and create my Client and use it as I would have created with Cognito 好吧,似乎我可以使用BasicAWSCredentials对象并创建我的Client并使用它,就像使用Cognito创建的那样

AWSCredentials credentials = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY);
    s3Client = new AmazonS3Client(credentials);
s3Client.setRegion(MY_REGION);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM