I'm trying to distribute an Android and iOS SDK through AWS S3 with credential authentication.
I've already successfully done it on the Android (that I've much more experience).
I've read these two awesome articles:
1 https://medium.com/streamroot-developers-blog/delivering-proprietary-libraries-via-amazon-s3-5aea2b7ccac8
2 https://medium.com/#porten/publishing-android-library-artifacts-to-amazon-s3-buckets-8db4231e844f
What I'm trying to do is something like the second link, that has the AWS authentication baked in.
I've achieved this goal on Android by creating a Groovy script that read the credentials from an encrypted file and communicate with the S3 bucket using Gradle.
How can I achieve the same thing with iOS?
PS.The example on the first link didn't shown how to authenticate
with the S3 bucket, I've assumed that is a public SDK
Related
I'm making a global iOS App with AWS SDK.
And there is a function for users to get image files; only if the requester is a friend of the image files' uploader.
For this function, I use AWS S3 for storage service with private access.
And I want to use CloudFront for my users to get download files faster.
I should set the bucket name for downloading on AWS S3 SDK, but it seems that the CloudFront does not support for this bucket name.
Is AWS CloudFront only for public things with url?
If you want to serve private content via CloudFront, you will find this doc useful http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html. Currently the AWS SDK for iOS doesn't support CloudFront directly. You need to manually sign the request. A related question is asked on AWS forum https://forums.aws.amazon.com/thread.jspa?messageID=336955.
Have you consider making your AWS S3 bucket public, and then encrypting all of the users pictures? You could push the keys through EC2 or another service and still get the performance of CloudFront.
However, even if you can download photos from CloudFront as indicated in https://forums.aws.amazon.com/thread.jspa?messageID=336955, it is HIGHLY not recommended to do so, because you will ship your private key pem file to the public together with your app. Yosuke said this clearly.
Is it possible to use the AWS mobile services (Cognito, Analytics, etc) without linking all the SDK in an Xcode project?
Background:
* While I am not new to AWS nor mobile programming, the following case is challenging:
We are shipping a mobile "framework" (not app) that uses our AWS for some parts (Authentication, logs).
And, as the AWS SDK has to be linked in the app project itself, this will require us asking all the clients (developers) to download and link it in their own projects.
What is used in the framework is just one request for authentication and one for logging (success/failure, disconnection), so no need for all the SDK.
I wonder if there is a possibility to request AWS services without linking against the SDK?
I know it's possible to put then under an umbrella SDK, or do some cherry picking from their git repository, but both of these seem like overkill.
As the request itself is a simple URL with Get/Post, is there a possibility (or tutorial) on constructing the request manually via NSURLConnexion/NSURLSession, etc?
Thank you
Talking to the AWS APIs is actually not that hard. The main difficulty is signing your http requests, and that's not nearly as bad as it sounds. Which leaves xml parsing accounting for most of the unpleasantness.
I've done it in go. The most informative part is probably the signing tests.
Indeed, it is possible. You will have to code calls to AWS at the REST level. Everything you need is in the documentation of AWS.
For instance, if you needed to execute actions on EC2, here's what you'd have to code:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#structure-of-a-get-request
You can call the HTTP APIs directly. Since the AWS Mobile SDK for iOS and Android are open source, you can look at them directly. Find the AWS Mobile SDK for iOS Source on Github, and the AWS Mobile SDK for Android on Github. Since you mentioned you need authentication request on iOS I am guessing you're looking for the Cognito Identity in AWSCore source.
I have an app using RestKit successfully. I am building an IAP in the app and for iOS5 I needed a place to host the app files for the IAP. I decided using Amazon S3 for that.
Now I now that I can integrate amazon API but I wish to keep my app simple, and since I am using RestKit I just want to use it to download the files.
Is there a guide or explanation on how to generate a bucket url with expiration and secrets ?
Thanks
Shani
Sure: all the information you need is in the Authenticating REST Requests documentation page.
Also, it's not entirely clear from your question, but I hope you're putting the URL generation in some web app somewhere that you control, rather than directly embedding it in the IOS app. I also hope you're using IAM to restrict that key to the appropriate permissions level regardless.
We are in the development of an iOS(iPhone) application that consumes a web services. We are planning to host our web service (ReSTful web services) in the AWS. Initially we planned to use Restkit or ASIHttpRequest libraries for invoking the web services. Our web services contains GET, POST api and some image uploading for setting the profile photos of the users. Also we are sending video, audio files in to the database and accessing these files through web services. We are using JSON as our output format.
While searching through the web we found that AWS SDK for iOS is this. Can somebody advice us is it possible to do the above requirements (GET/POST/Upload Photo/etc) using AWS SDK for iOS? Or shall we continue with other third-party libraries like Restkit or ASIHttpRequest.
Please advise us.
You can use both ASIHttpRequest and Amazon SDK for IOS at the same time.You would want to use Amazon S3 service (by creating a bucket) for your media files.Amazon S3 is cheap,fast and easy to use. When you download AWS SDK you can see sample folder and an example of S3_Uploader for ios.
For example in my latest app user upload their photos to Amazon S3 and comment&vote to other user pictures etc... I use AWS SDK to upload pictures to the Amazon S3 service. While uploading photos with AWS SDK I keep URL,path, of the photos in a database and use ASIHttpRequest , POSTto update my MYSQL database, which is in another server. When I fetch data from my server I use JSON and AWS SDK.
So If I were you, I would use Amazon S3 for my files(photo,video etc...) and I would use either Amazon EC2 or another web service for rest of the database. I am assuming you keep your data in a database and interact thru GET and POST methods. If so keeping media files and database in separate places would be my choice
I'm having issues integrating the AWS iOS SDK (authentication specifically) along with download of a simple URL from a bucket.
I'm using StackMob to store my data, and files are managed through AWS in S3 storage. When querying for an object, the link to the S3 object is given.
I have implemented the Anonymous bucket token registration, and it works fine in the demo application, I can see all the buckets as well as the files in the buckets but here's the big question:
How do I authenticate with AWS using the iOS SDK, and use that authentication to download a URL to an object in my bucket that I already have the link to?
Going directly to that link brings up an access denied error. Also, some of the files are private and not distributed, so I do not want to just make the entire bucket public for people to access with the link.
Any suggestions? I think I read somewhere that you can manipulate the URL to include your access key and secret key, but that you should never include that in a binary as it could get stolen, so maybe having it on a private server and pulling that key to temporarily use it?
Any help would be great!
Thanks
I contacted Amazon support, and it turns out that what I'm looking to do is currently impossible with the SDK.
The only way to generate a URL is having the bucket name, key, and use the "getPreSignedURL" API call to get a signed link to it.
I'll leave this up, hopefully someone will learn from this and not have to pay $50/month for support for this one question.