2017-07-25 7 views
1

Je voudrais ajouter l'option de connexion facebook à mon site Web. J'essaie de suivre this tutorial. Mais si j'ajoute la partie knpu_guard dans la section principale, je reçois cette erreur:Option non reconnue "knpu_guard" sous "security.firewalls.main" (Symfony)

Unrecognized option "knpu_guard" under "security.firewalls.main" 

section Mon firewalls dans le security.yml ressemble à ceci:

firewalls: 
    main: 
     anonymous: ~ 
     #pattern: ^/ 
     provider: our_db_provider 
     form_login: 
      login_path: login 
      check_path: login 
     logout: 
      path: /logout 
      target:/
     knpu_guard: 
      authenticators: 
       - app.form_login_authenticator 
       - app.api_token_authenticator 
       - app.facebook_authenticator 
      # by default, use the start() function from FormLoginAuthenticator 
      entry_point: app.form_login_authenticator 

Je viens d'ajouter la section knpu_guard, rien d'autre changé sous le firewalls section

Répondre

1

Je pense que le tutoriel est un peu obsolète car knpu_guard n'est plus accepté.

Vous pouvez utiliser guard plutôt comme une clé dans le fichier security.yml

Discussion

Try d'utiliser cette

form_login: 
    login_path: login 
    check_path: login 
    provider: user_provider #where is this provider? It shouldn't be fos_userbundle for example? 
anonymous: true 
+0

Dois-je changer quoi que ce soit d'autre dans le code? –

+0

Maintenant, je reçois cette erreur: 'Le service" security.authentication.manager "a une dépendance sur un service inexistant" app.log_authenticator ". –

+0

J'ai mis à jour la réponse, mais il est difficile de bien comprendre le problème maintenant –