我使用Symfony 3.4和FOSUSERBundle,我的facebook按钮正在工作,然后突然间没有。只需 "请求中没有oauth代码" 消息。
有人可以告诉我配置不正确的地方,或者共享一个可行的配置吗?
/config.yml
hwi_oauth:
firewall_names: ["main"]
fosub:
username_iterations: 30
properties:
facebook: facebook_id
resource_owners:
facebook:
type: facebook
client_id: "1xxxxxxxxxxxxxxx3"
client_secret: "exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6"
scope: email
infos_url: "https://graph.facebook.com/me?fields=id,email,gender,last_name,first_name,birthday,picture.type(square)"
options:
csrf: true
/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: "@FOSUserBundle/Resources/config/routing/security.xml"
prefix: /
facebook_login:
path: /connect/check-facebook
/security.yml
security:
#...
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
#...
#HWIOAuthBundle
oauth:
login_path: /login
failure_path: /login
resource_owners:
facebook: "/connect/check-facebook"
/services.yml
services:
app.fos_user.oauth_provider:
# Change the class according to the location of the FOSUBUserProvider class
class: EC\UserBundle\Entity\FOSUBUserProvider
arguments: ['@fos_user.user_manager',{facebook: facebook_id}]