FOSFacebookBundle icon indicating copy to clipboard operation
FOSFacebookBundle copied to clipboard

multiple authentication providers

Open bitgandtter opened this issue 12 years ago • 2 comments

Hi i use TwitterBundle, FacebookBundle and UserBundle in my application and try to put together this 3 authentication mechanisms, but only get the entry point of the firewall the first i set in my security configuration, so i implement a fix or workaround to this problem. Here is the solution i found:

Before:

FacebookListener.php

/**

Facebook authentication listener. */ class FacebookListener extends AbstractAuthenticationListener { protected function attemptAuthentication(Request $request) { return $this->authenticationManager->authenticate(new FacebookUserToken($this->providerKey)); } }

After:

/**

Facebook authentication listener. */ class FacebookListener extends AbstractAuthenticationListener { protected function attemptAuthentication(Request $request) { if(!$request->getQueryString()) return $this->authenticationManager->authenticate(new FacebookUserToken($this->providerKey)); return null; } }

If there is another way to doit please answer me, thanks.

I will be very glad if FacebookBundle developers fix this issue and get the code merge into the branch.

bitgandtter avatar Jun 27 '12 03:06 bitgandtter

My word, may all your days be golden. You have just helped me solve a problem that has been the biggest pain in my balls for ages and ages. Thank you.

ChrisNoel avatar May 09 '13 08:05 ChrisNoel

thanks you are welcome to use my fork of this bundle and contribute to it if you want it

bitgandtter avatar May 18 '13 03:05 bitgandtter