I need an idiots guide explanation to understand generally how do you authenticate users in your ios app when you have a web based backend? I use tornado and django and understand how to use get/post/delete/update using restkit but theoretically i don’t understand authentication requests.
P.S. I have found a good tutorial using restkit for authentication which helped here:
http://benoitc.github.com/restkit/authentication.html
That can be done in multiple ways ill explain the easiest, first lets setup our enviroment, we do have:
www.yourSite.com/login.php: this will take user=”name” and passowrd=”password”, and it will echo back a session ID.www.yourSite.com/isloggedin.php: to check if user is logged inwww.yoursite.com/logout.php: to logout from your sessionFirst you would call login.php sending the user name and the password (
login.php?user=someuser&passowd=pass) this call will echo back a session ID (that will be kept alive for you at the server side)Then later on you could call
isloggedin.php?session=here_set_the_session_returned_earlier, if you didnt log out this will return yes for exampleLater if you want to logout you could call
www.yoursite.com/logout.php?session=same_session, that will destroy the session saved in the login functionThere are alot of other ways to implement this, but in my opinion this is the easiest way