CakePHP 2.0 and mobile application authentication

后端 未结 1 1417
粉色の甜心
粉色の甜心 2021-01-15 00:36

I\'m going nuts over here! I\'ve got a website I am making in CakePHP that will form the back end of a mobile application. It is not a mobile website, it\'s designed purely

1条回答
  •  礼貌的吻别
    2021-01-15 01:07

    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's rest plugin it may be of interest https://github.com/kvz/cakephp-rest-plugin

    0 讨论(0)
提交回复
热议问题