上传到Amazon S3无法获得和放大器;密钥 [英] Uploading to Amazon S3 without access & secret key

查看:231
本文介绍了上传到Amazon S3无法获得和放大器;密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当我上传到S3存储,我使用一个AmazonS3Client是这样的:

Usually when I upload to S3 storage, I use an AmazonS3Client like this:

var client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey, secretKey, s3Config)

这工作正常供内部使用,但现在我期待在提供应用程序给外部用户,不希望我们(sacret)接入和放大器;密钥到这里来了。我已经成立了一个S3桶来自匿名用户的水桶政策,允许上传(PutObject),但我怎么使用Amazon SDK吗?我似乎无法找到任何方式不提供访问和密钥。

This works fine for internal use but now I am looking at providing an app to external users and don't want our (sacret) access & secret keys to be out there. I've set up an S3 bucket with a bucket policy allowing uploads (PutObject) from anonymous users but how do I use the Amazon SDK now? I can't seem to find any way without providing the access and secret key.

推荐答案

您只需要通过 ACCESSKEY SecretKey的键,您可以使用SDK的任何匿名允许操作。

You just need to pass null for accessKey and secretKey and you can use the SDK for any anonymously allowed operation.

看看这个有关问题的矿井的,它包括从亚马逊的员工从他们的开发者论坛官方回应!从链接的问题的有关信息:

Check out this related question of mine it includes an official response from an Amazon employee from their developer forum! Relevant information from the linked question:

这是从他们的论坛正式亚马逊员工:

This is from an official Amazon employee on their forum:

随着1.3.8.0版本的SDK,你可以通过在访问空   和密钥和SDK将跳过签名过程并尝试   像GetObject的业务作为一个公共操作。

As of the 1.3.8.0 release of the SDK you can pass null for the access and secret key and the SDK will skip the signing process and try the operations like GetObject as a public operation.

规范

这篇关于上传到Amazon S3无法获得和放大器;密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆