mongodb - How to use two collections to authenticate zfcuser? -
i utilize doctrine , mongodb odm modules @ zf2 application. zfcuser used authorization.
is there way utilize 2 collections, users , clients authenticate via zfcuser+doctrine? curious, if there way combine 2 mongo collections 1 utilize combined authentication?
you not need merge users 1 collection can have multiple 'authentication adapters' (see zfcuser\authentication\adapter\db example)
these defined within global config file: zfcuser.global.php
each of adapters run in order of priority until 1 returns successful authentication result.
for example; have next configuration users , candidates entities.
/** * authentication adapters * * specify adapters used seek , authenticate user * * default value: array containing 'zfcuser\authentication\adapter\db' priority 100 * accepted values: array containing services implement 'zfcuser\authentication\adapter\chainableadapter' */ 'auth_adapters' => array( 50 => 'jobboardcandidate\authentication\adapter\candidatedatabaseadapter', 75 => 'jobboarduser\authentication\adapter\userdatabaseadapter', //100 => 'zfcuser\authentication\adapter\db', [this default] ), mongodb authentication doctrine2 zend-framework2 zfcuser
No comments:
Post a Comment