Retrieving image url with specific access privileges using AWS Mobile SDK for Android

 ̄綄美尐妖づ 提交于 2019-12-12 03:45:37

问题


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.

How would I go about doing this?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/30941673/retrieving-image-url-with-specific-access-privileges-using-aws-mobile-sdk-for-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!