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

1

0

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?

Nympholepsy answered 19/6, 2015 at 15:15 Comment(0)
S
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.

Spaceless answered 22/6, 2015 at 19:36 Comment(1)
Keep in mind Dillon, that you can still create a pre-signed URL for an object... but the access control restrictions are on whoever creates the URL, not the URL itself. So if your account has access, you can create a temporary pre-signed url and pass it around.Spaceless

© 2022 - 2024 — McMap. All rights reserved.