views:

49

answers:

1

Hello, i am thinking of using Zend_Auth as the Authentication "mechanism" (component) for a web site. After a quick look a realized that for Database Table Authentication i will also have to use the Zend_Db component.

Has anyone tried this approach? Am i forced to use and/or extend/implement the Zend_DB methods/interfaces in order to have Zend_Auth integrated in a web site (web application?).

Can i plug-in my own DB Abstraction layer into the Zend_Auth component and instruct Zend_Auth to use it for Database Table Authentication easily? I am trying to figure out if such a solution is worth the effort.

+2  A: 

You could do it you just need to write your own Zend_Auth adapter that will make use of your Abastraction layer. Its not really that complex as there arent that many required methods to implement/overload. Ive done it using Doctrine, a raw PDO connection, as well as a Zend_Db based simple ORM. If youre requirements for the actual functionality are minimal you should be able to get it done in a minimal amount of time (hours or minutes as opposed to days).

prodigitalson
Upvoted for this one. It's actually fairly easy to write a Zend_Auth adapter - in fact, for an example, check out one of the recent tutorials on ZendCasts.com - http://www.zendcasts.com/writing-a-zend_auth_adapter-with-doctrine/2010/01/ - and that'll explain how to do it properly.
Stephen Orr