FriendsOfSymfony / FOSFacebookBundle

NOT MAINTAINED - see https://github.com/hwi/HWIOAuthBundle
321 stars 140 forks source link

multiple authentication providers #157

Open bitgandtter opened 12 years ago

bitgandtter commented 12 years ago

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.

ChrisNoel commented 11 years ago

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.

bitgandtter commented 11 years ago

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