CakePHP 2.0 and Mobile Application Authentication

I'm going crazy! I have a website that I create in CakePHP that will form the back end of a mobile application. This is not a mobile site designed exclusively for use on a smartphone.

The aforesaid: the application needs the user to log in. But I just can't find the right way to implement this. The BasicAuthenticate AuthComponent seems to hate me and doesn't make debugging easy. There is an OAuth 2.0 Provider Plugin for CakePHP 2.0 , but I can’t figure out how to make it 2 legged, since the application will not rely on the website to display the login form.

I really need to figure out which of these paths to take and how to make it work, but no one just wants to work. Does anyone have any info on what I need to do?

Update . The main problem with Auth was that Virtualmin preferred to use FCGId to let the process run as the same owner as the contents of the website. Since then, I switched it back to mod_php and it works great.

So now I am wondering about using cakephp-oauth-server in a two-step setup.

+2
source share
1 answer
public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('index','view'); $this->set('logged_in', $this->Auth->loggedIn()); $this->set('current_user',$this->Auth->user()); if($this->name == 'Specific') { // for the specific controller $this->Auth->authenticate = array('Basic'); } else { // everything else } } 

checkout KVZ rest plugin may be of interest https://github.com/kvz/cakephp-rest-plugin

+2
source

All Articles