mohsen
mohsen

Reputation: 43

Authentication in zend framework 2

I am going to write an Authentication module using the Zend Framework 2. To help me with this process, I found this tutorial in the web. However, when I run this module, it shows this message:

Class Zend\Authentication\Adapter\AdapterChain does not exist

What is the meaning of this message?

Additionally, do you know of a Zend Framework 2 Authentication tutorial I could use for assisstance as I write my own?

Upvotes: 5

Views: 13418

Answers (6)

Renaat De Muynck
Renaat De Muynck

Reputation: 3347

I have created my own authentication adapter for this in one of my projects. I've created a gist. You can use it like this:

$adapter = new AdapterChain([
    new \Zend\Authentication\Adapter\Ldap(/* ... */),
    new \Zend\Authentication\Adapter\DbTable(/* ... */)
    // ...
]);

$authService = new AuthenticationService();
$authService->setAdapter($adapter);

Upvotes: 0

Rob Shipley
Rob Shipley

Reputation: 11

The EdpUser as mentioned above has been consumed by ZfcUser. That works will with ZF2 as Evan Dot Pro is a core contributor to ZF2. In relation to managing Acl's, ZfcAcl is currently not working with ZF2 RC1. It's a little behind the time now.

They have a RFC open to make updates but that looks like it's a little way down the line. I'd possibly recommend using BjyAuthorize. Zf-Commons are considering taking this over as well.

Upvotes: 1

Developer
Developer

Reputation: 26173

you can create your own customized plugin in zf2 something like this Acl implimentation in ZF2

Upvotes: 1

Nikolai Senkevich
Nikolai Senkevich

Reputation: 2390

I was also using this tutorial month ago is to old and not working with beta5
You can try to play with
https://github.com/EvanDotPro/EdpUser it nicely writen and have cool things as view helpers for login form and auth status

Upvotes: 0

Maw
Maw

Reputation: 9

Try Authentication + Acl using EventManager. It looks like easier than ZfcAcl.

Upvotes: 0

Rob Allen
Rob Allen

Reputation: 12778

Look at ZFC-Common's ZfcAcl.

Upvotes: 2

Related Questions