I am using Zend_Auth
for authentication in a web portal.
A normal mySQL \"users\" table with a login
and password
column gets quer
Because Zend_Auth is a singleton, creating custom auth adapters for each authentication source only solves the first half of this issue. The second half of the issue is that you want to be able to log in simultaneously with multiple accounts: one of each authentication source.
I asked a similar question recently. The solution was to extend Zend_Auth as shown in the accepted answer. I then initialize the different authentication types in my bootstrap.
protected function _initAuth()
{
Zend_Registry::set('auth1', new My_Auth('auth1'));
Zend_Registry::set('auth2', new My_Auth('auth2'));
Zend_Registry::set('auth3', new My_Auth('auth3'));
}
So, instead of the singleton Zend_Auth::getInstance()
you would use Zend_Registry::get('auth1')
, etc.