Yii Framework Forum: Mobile Client For Yii App - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Mobile Client For Yii App Application interaction on the mobile side Rate Topic: -----

#1 User is offline   beesho 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 21-September 12

Posted 01 February 2013 - 07:19 PM

I am trying to create a mobile end client for my Yii application. I researched about that and I knew that I should integrate REST API first, and that is what I did.
Now, am looking for a way to use javascript(or any better way) to authenticate the user and interact with the application, but I failed to do that so far..
Any help in the matter is much appreciated.
Thanks in advance.
0

#2 User is offline   Luke Jurgs 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 16-October 11
  • Location:Australia

Posted 01 February 2013 - 10:44 PM

Hi Beesho,

What have you tried so far? I use backbone myself and I find that user authentication has no established best practice. I myself deviate from true REST and use session cookies to track authentication. I then set a 401 Unauthorized header and return a JSON string that tells my backbone client that it needs to route to the login page.

The login page asks for a username and password that is then transmitted as an update "put" and my rest controller for account tells the application if it was successful or not with a 200 or 406 header, then I route back to where the user first needed authentication to proceed.

There's always a better way, I'm a bit of a backbone novice so I'm always looking for better ways.

View Postbeesho, on 01 February 2013 - 07:19 PM, said:

I am trying to create a mobile end client for my Yii application. I researched about that and I knew that I should integrate REST API first, and that is what I did.
Now, am looking for a way to use javascript(or any better way) to authenticate the user and interact with the application, but I failed to do that so far..
Any help in the matter is much appreciated.
Thanks in advance.

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users