Closed klaussilveira closed 11 years ago
try to add check_path to your provider configuration, as above:
security:
providers:
chain_provider:
chain:
providers: [main, fb_provider]
main:
entity: { class: AcmeBundle:User, property: username }
fb_provider:
id: facebook_user_provider
firewalls:
main:
pattern: ^/
form_login:
check_path: /login-check
provider: main
logout: true
anonymous: true
fos_facebook:
check_path: /login-check-fb
app_url: "http://apps.facebook.com/acme/"
server_url: "http://acme.dev/app_dev.php/"
provider: fb_provider
I guess it will trigger the rigth provider.
@klaussilveira, I'm currently running into the same issue. Could it be possible to share me your FacebookProvider ? I decided to create my own User Provider and i'm wondering if I have to replace the user manager argument needed by the FacebookProvider to my UserRepository. I'm sorry for my poor english.
I have a custom entity provider, formed by a custom
User
entity class and aUserRepository
that extends theEntityRepository
class.I also have a
FacebookProvider
based on the one available here. It's modified to communicate with myUserRepository
.They're all registered as such:
Problem is: i want users to login using the normal login form, using the
UserRepository
, instead of Facebook. Facebook is now used everywhere, intercepting the normal login form, instead of issuing proper default User AuthorizationTokens."The Facebook user could not be retrieved from the session." is shown, since i'm not using the correct provider. How can i work with multiple providers? A Facebook provider for FB logins and my Entity Provider for normal logins?