使用适用于Android的AWS Mobile SDK检索具有特定访问权限的图像URL [英] Retrieving image url with specific access privileges using AWS Mobile SDK for Android

查看:110
本文介绍了使用适用于Android的AWS Mobile SDK检索具有特定访问权限的图像URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用AWS Android SDK检索具有非公共访问权限的图像URL.我将自己通过URL显示图像,但是我不确定如何通过秘密访问密钥获取权限.

I would like to retrieve an image URL with non-public access using the AWS Android SDK. I will be displaying the image via the URL myself, but I'm not sure how to go about getting permissions via the secret access key.

我想将这些图像设为不公开,因此对我来说,公开这些图像不是一种选择.

I would like to keep these images private, so making them public is not an option for me.

我该怎么做?

推荐答案

无法使用URL本身内置的访问控制来创建图像的URL.因为如果仅URL是内置访问权限的内容(即已嵌入签名),那么谁拥有URL就无关紧要.

There is no way to create a URL to an image with access control built into the URL per se. Because if the URL alone is what has the access built into it (i.e. it has the signature already embedded), then who has the URL is not relevant.

假设您正在使用Amazon Cognito(您可能应该使用)向您的应用程序出售临时凭证.然后,您可以使用 IAM角色来限制访问将此图像仅显示给您自己.从那里您可以自己获取图像,也可以使用临时凭证

Assuming you are using Amazon Cognito (which you probably should be) to vend temporary credentials to you application. You can then use IAM roles to restrict access to this image to just yourself. From there you could get the image yourself, or using the temporary credentials, create a pre-signed URL. However anyone with that URL will have access to the image for the duration up to its expiration.

这篇关于使用适用于Android的AWS Mobile SDK检索具有特定访问权限的图像URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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