|Jul 9, 2010, 04:18 AM||#1|
login and Authorization in app
I would like to let the user login and get data from another service, within my app. In order to enable this, the other service and I have been in touch and because they are using OAuth I have become a Consumerkey and Sharedsecret.
The question is:
How do I correctly and safe, get the data from this other service, in my app?
A possible progress could be:
- the user clicks on a button "get my data" or something.
- the user gives in password and username (for the other service)
- my app connects via NSURLConnection to the other service
- the user waits as long as the authorization is done
- the data is displayed in my app
I do not know how to "translate" this in a proper way? If this would be a web site, I would do the following:
My web site is the Consumer and must use OAuth to gain access to the user data in order to display them. I am known in OAuth as a Consumer Developer and have a Consumer Key and a Consumer secret.
The User clicks on a button on the page, like get my account data, and my web site requests from the other service a Request Token. At this point, the Request Token is not User-specific, and can be used by my web site to gain User approval from the User to access the private data.
My web site receives the Request Token and redirects the User to the other service's OAuth User Authorization URL with the Request Token and asks the other service to redirect the user back once approval has been granted to http://myWebSite/getData.
The user is now (after the redirection) requested to sign in. OAuth requires that Service Providers first authenticate the User, and then ask them to grant access to the Consumer.
OAuth allows the user to keep the username and password private and not share them with my Web site or any other site. At no time does the user enters the credentials into my web site.
After successfully logging in to the other service the user is asked to grant access to my Web site, aka the Consumer. The user can approve or deny access.
Once the user approves the request, the other service marks the Request Token as User-authorized by the user. The userís browser is redirected back to my web site, to the URL previously provided http://myWebSite/getData together with the Request Token. This allows my web site to know it can now continue to fetch the user data.
While the user waits, my web site uses the authorized Request Token and exchanges it for an Access Token. My web site exchanges the Request Token for an Access Token and request the data.
When my web site is done, the Userís browser refreshes to display the user data.
Every hint and help is very welcome!
Thanks in advance!
|Jul 9, 2010, 06:27 AM||#2|
No ideas on this issue?
Some more concrete questions are:
- there are no sessions in an iPhone app - how do you create "safe spaces" in an iPhone app? Ie how to differenciate if the user is logged in or not?
|Jul 9, 2010, 04:38 PM||#3|
If you google GData objective-C you'll come across a library in code.google.com that deals with OAuth quite nicely. I actualy spent last night working with it and it seems pretty good.
Free iOS App that turns your music library into an info graphic.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|In App purchases and ways to do it||phillydogg28||iPhone/iPad Programming||3||Jul 13, 2011 08:29 PM|
|Using device camera and video in app||Casey-Scalf||iPhone/iPad Programming||3||Feb 10, 2011 04:18 AM|
|New iPhoto icon in App Store Promo Image?||Jason S.||Mac Applications and Mac App Store||2||Jan 6, 2011 02:20 PM|
|iOS 4 for iPhone: Group Messaging and + Symbol in App Store||mystermike||iPhone Tips, Help and Troubleshooting||11||Dec 27, 2010 12:31 AM|
|App Updates not appearing in App Store on iPad||Billboard||iPad||3||Nov 22, 2010 10:39 PM|
All times are GMT -5. The time now is 09:36 AM.