1
我想在我的Sylius商店中添加社交連接按鈕,但我無法做到這一點。 我通過作曲家安裝HWIOAuthBundle:爲商店用戶配置OAuth2訪問
$ composer require hwi/oauth-bundle
然後,根據HWIOAuthBundle documentation,這裏是我的配置文件:
應用程序/配置/ routing.yml中
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_connect:
resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /login
facebook_login:
path: /login/check-facebook
應用程序/配置/config.yml
hwi_oauth:
firewall_names: [secured_area]
resource_owners:
any_name:
type: facebook
client_id: <client_id>
client_secret: <client_secret>
options:
display: popup #dialog is optimized for popup window
auth_type: rerequest # Re-asking for Declined Permissions
應用程序/配置/ security.yml
firewalls:
secured_area:
anonymous: ~
oauth:
resource_owners:
facebook: "/login/check-facebook"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: sylius.oauth.user_provider
當我啓動服務器時,我得到這個錯誤:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "sylius.oauth.user_provider" has a dependency on a non-existent service "sylius.factory.admin_user_oauth".
你對如何解決它的任何想法? Sylius的文檔非常簡短,甚至通過在提交評論中搜索,我無法找到任何線索。
感謝您的幫助!
是否有人對如何HWIOAuthBundle融入Sylius一個簡單的指南? – Gontran