我这里快要疯了!我正在用 CakePHP 制作一个网站,它将构成移动应用程序的后端。它不是一个移动网站,它纯粹是为了用于智能手机应用程序而设计的。
That being said: The application needs the user to login. But I just cannot seem to find the right way to implement this. The BasicAuthenticate AuthComponent seems to hate me and doesn't make debugging easy. There's an OAuth 2.0 Provider plugin for CakePHP 2.0, but I can't figure out how to make it 2 legged, as the app won't be relying on the website to display a login form.
我真的需要弄清楚该走哪一条路以及如何让它发挥作用,但没有人愿意工作。有人知道我需要做什么吗?
Update事实证明,基本身份验证问题是由于 Virtualmin 更喜欢使用 FCGId 来允许进程以与网站内容相同的所有者身份运行。我已经将其切换回 mod_php 并且工作正常。
所以我的问题现在更多的是关于使用cakephp-oauth-服务器在 2 条腿的设置中。
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
}
}
查看 KVZ 的 Rest 插件,可能会感兴趣https://github.com/kvz/cakephp-rest-plugin
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)