Assuming I want to create an app that allows users to login. The accounts are stored securely in a server. Some pages are also not visible to users who haven’t logged in yet. Can someone guide me on how to do so? So like how to deal with “sessions” and all that. How would I do that if the database online is MySQL?
On another note, to implement “OAuth” the database has to be OAuth-compatible, am I right on this? And if so, how would I use OAuth on iOS? Is there an Apple API for that?
I appreciate any help / guidance
Thank you,
Let’s do this part by part:
the server-side of things. Be it
MySQL, Oracle, SQLite, if you have a
dynamic language that connects to
that DB and outputs XML or JSON
data, you’re set.
Dealing with sessions is easy. You
can use
NSHTTPCookieStoragetohave that handled automatically for
you. Because sessions are set via a
cookie, any HTTP request will set
that cookie locally and send it in
future requests.
As far as permissions go, I would do
that validation server-side. Because
you have the session, and you should
know server-side wether the user is
logged in or not, just send a list
of pages the user can see.
can use. The OAuth project lists a
couple that seem straightforward
enough to use. If you’re looking for
Twitter integration however, a
question has been asked here
with pretty good answers.
things, this can be easily achieved
using a dynamic language such as PHP
or using the Ruby on Rails
framework. RoR is really good in
that aspect in the sense that you
can quickly bring an API up by using
its gems (Devise, OAuth2,
etc)