I'm using ZF2
in combination with ZFCUser
and bjyauthorize
. I have a landing page which should be globally accessable. All other pages need to be behind a login.
At first I blamed bjyauthorize
for not letting guest users access my landing page. But after some discussions it seems that ZFCUser
is blocking the way.
My question is: How can I tell ZFCUser not to block one page/action?
Edit:
My Application/Module.php
looks like in this post. When I add my app myApp
to the whitlist, I can access my landing page but all other actions from myApp
as well.
Any ideas how to alter the condition that I can match the URL or just whitlist my frontend-action?
Maybe I could add a second route to my landing page. But that's not a clean solution, right?
If you insist on checking authentication in the onBoostrap method you could do something like this:
I've just changed the code a little but so your white list also contains specific actions. Then we can check the action parameter to be a little bit more specific with your white listing.
I don't know if this is the best way to do it, I'm just showing you how you can do it.
I don't think you even need to check authentication when using
BjyAuthorize
as you can just use resource checks. If a user has anything other than a guest role then they are a real user and are authenticated. Again, I'm not 100% on that but I do know that I don't useZfcUser
authentication checks in my application which usesBjyAuthorize
. I just use route guards to specify the role level needed for a aparticular route.Maybe somebody else could clarify this?