external user authentication


is possible to use an external php application to manage user login and authentication?

So that all web-server applications refer to it for login /logout and to check if a user is already logged in?



Hi Riccardo,

Yes it is, what you need to do is to code your authenticate function in your protected/components/UserIdentity.php to perform remote calls for authentication. Once you authenticate the user -and if allowAutoLogin is set, login creds are saved, renew and restored from cookie so… [not tested]

One example could be to use an HttpClient to call REST or SOAP service for authentication and depending on server response it gets that token. I missed so much that class on Yii, that I am actually translating Zend class for a more Yii’s approach. Nevertheless, you can work with Zend together with Yii (http://www.yiiframework.com/forum/index.php?/topic/2666-integrate-with-zend-framework/page__p__14803__hl__u+ing+zend#entry14803)

For a close look to the authentication flow check Yii/web/auth/CWebUser and CUserIdentity.

If you create an app (look at your protected/components/UserIdentity.php and your protected/models/User.php