Native Android Application Login

Hey guys,

First of all, I have tried a couple of frameworks (Symfony2 and Kohana) and didn’t find them too easy for setting up. Next came Yii and everything is just so much easier! I’m very happy with this framework.

Basically, I’ve got a website setup with some accounts which can login. I still need to learn how to create a registration form which is high up on the priority list.

For now, the most important thing I need working is login via the native Android application we (my company) have setup. What I want to know, is there any way of connecting the app to Yii (via HTTP POST or something similar) to enable login for the app? E.g. Maybe create a script which logs in and supplies the session to the app and details of the logged in user too (encoded in JSON maybe)? Otherwise, is there another approach available? We will eventually need this for iOS as well.

Even if someone were to point me in the right direction that would be greatly appreciated!

Cheers,

Adam

Server OS: Fedora 16

Web Server Installed: Nginx (installed less than a month ago so it’s a fairly new version)

Database: MySQL

Yii: 1.1.9

Android: 2.2 and higher

in fact you can authenticate user whatever you want…

for example you can pass http authentication headers and in action first set user according to that settings:

prapare your own UserIdentity class which will validate HTTP auth headers, and pass it to Yii::app()->user->login( $identity );

if your app supports cookies - you can relay on session that this user will be stored for next requests, if not - you can authenticate on every request (for example put authentication code in your base Controller class in beforeAction($action) handler)

I don’t suppose you could provide an example of a UserIdentity class that could meet those requirements? We seem to be a little lost.