我遵循了包文档为facebook配置HWIOAuthBundle。然后我按照这的例子来显示facebook登录按钮,它看起来很好用,但是它还没有完成。我被困住了,不知道下一步该怎么办。在我按下facebook登录按钮并登录到facebook后,我会得到错误:
Unable to find the controller for path "/sign-in/check-facebook". The route is wrongly configured.config.yml
hwi_oauth:
firewall_name: hwi_oauth
resource_owners:
facebook:
type: facebook
client_id: "%facebook_client_id%"
client_secret: "%facebook_client_secret%"
scope: email
options:
display: popup
auth_type: rerequest
csrf: truesecurity.yml
firewalls:
hwi_oauth:
pattern: ^/
anonymous: ~
oauth:
resource_owners:
facebook: /sign-in/check-facebook
login_path: /sign-in
failure_path: /sign-in
oauth_user_provider:
service: oauth_user_providerrouting.yml
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /sign-in
facebook_login:
path: /sign-in/check-facebook那么,这个/sign-in/check-facebook需要做什么呢?为什么我的申请找不到?我必须为它创建控制器吗?
在文档这里中,据说信息可以通过response对象获得,但是我在哪里编写这段代码呢?
发布于 2016-06-20 20:18:50
看看你的security.yml。在hwi_oauth防火墙之前,应用程序可能会处理其他防火墙吗?看来@jkuri在这里有这个问题:https://github.com/hwi/HWIOAuthBundle/issues/781#issuecomment-100468744
他的回答是:
回答我自己的问题..。在主防火墙之前增加了防火墙olta_portal .不知道问题出在哪里,可能是因为这两个防火墙的模式^/相同。现在开始工作。
我以前也和这个问题做过斗争!另一个正确的检查是执行一个php app/console debug:router | grep facebook,以验证您的路由是否已经在应用程序中注册。
发布于 2017-01-16 13:44:05
在配置HWIOAuthBundle时,我做了很多工作,所以当我最终得到正确的配置时,我通过在相当不错的教程中添加它来确保永远不会忘记它。
firewalls:
main:
pattern: ^/
oauth:
failure_path: your_path
login_path: your_path
check_path: /connect_check
provider: fos_userbundle
resource_owners:
facebook: "/login/check-facebook"
google: "/login/check-google"
oauth_user_provider:
service: app.provider.oauth本教程还解释了如何正确设置FOSUBUserProvider、UserModel和如何添加链接。
https://stackoverflow.com/questions/37924559
复制相似问题