symfony/symfony — Issue #2864: Anonymous && Custom provider && AuthenticationProviderManager.php
Author: armetiz
Created: 2011-12-13 14:01:28+00:00
State: open

Hi there,

When using anonymous: true inside security.yml, anonymous user should be use for a firewall where no specific role is needed.

Maybe I have do a wrong job,
I have build a custom Listener / Provider to be able to use FacebookToken.

The Listener check if headers contains "facebook-token", if not return null for the handle function.
For a specific area, I'm using HTTP Basic authentication & my Facebook authentication.

The problem is, that if a user provider a "facebook-token" parameters inside HTTP headers. The custom listener call to authenticationManager->authenticate($token) to check token on active provider.
If the Facebook provider can authenticate the user, it work. But, if the Facebook provider can't authenticate the user, then the HTTP Basic Authentication is launch and the HTTP response contains "WWW-Authenticate".

If I'm not clear, tell me.

The question is, how can I stop authentication if the Facebook authentication fails ?

I think the solution is to use Provider::isSupport.
The custom token, which is a FacebookUserToken extends AbstractToken. If I create a FacebookUserToken which extends TokenInterface only, maybe It can work.. But, it's really not a funny way.. isn't it ?

Thanks for reading.
Armetiz.