I spent many hours trying to get my head around services and oauth. Could someone please help me with the following?

Here is what I need to do:
I have a drupal site with ubercart. Users can buy a keycode that they can use in an iphone app, in order to download a file from the drupal site. Once the client completes the checkout, the user id, node id holding the file to send and the (randomly generated) keycode are inserted in a table from a custom module that I wrote.

Users can then use this keycode from within the app to contact the server.
The server checks the entry in db, and sends back the file.
Users shouldn't need to log in to drupal from within the app.

In order to achieve the above, I used services to set up a REST server, and a custom module where I create a new resource and handle the requests. My resource and all the above work fine when tested with e.g. Poster firefox plugin. So the server is ready to receive a rest request like: example.com/{endpoint}/my_resource/XX?keycode=PNBc3zkO - where XX is the node id and respond with the file.

And here is where I got stuck (brace yourselves, lots of questions coming):

how to allow only my iphone app to have access to the drupal REST server? Is this where oauth comes into play?

If so, could someone please provide me with basic tips:
Do I need to use "Default required authentication:Unsigned with consumer key" ?
Users shouldn't need to add a consumer in their profile (e.g. user/*/oauth/consumer/add ) is there a way to avoid that?
(if not, should I try to automatically insert that with rules?)

An SSL will be installed for the drupal REST server - iphone app interaction.

I am really confused, so any guidance or any tip would be really appreciated. Thanks!!

Comments

kylebrowning’s picture

Project: Services » OAuth 1.0
devkinetic’s picture

Yes this is what oauth is for. You should create a user in drupal for handling the requests, assign it a role with minimal permissions. Add the authentication keys to that user only. once you enable and setup oauth, you should be able to enable oauth for the server and select the context you defined.

juampynr’s picture

Status: Active » Fixed

No more feedback from the issue author. Marking it as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.