想实现登录谷歌使用的Symfony HWIOAuthBundle
我的网站无法识别的选项“谷歌”,“security.firewalls.secured_area.oauth”下
我的问题:
无法识别的选项“谷歌” 下“security.firewalls.secured_area.oauth”
我的client_id和client_secret很好,并且从Google收到,我只是不会因为隐私而粘贴它。
现在用这个HWIOAuthBundle Documentation
hwi_oauth:
firewall_names: [secured_area]
resource_owners:
any_name:
type: google
client_id: myid
client_secret: mysecret
scope: "https://www.googleapis.com/auth/plus.login"
options:
request_visible_actions: "http://schemas.google.com/AddActivity http://schemas.google.com/CommentActivity"
我Security.yml
文件:
安全:
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
in_memory:
memory: ~
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
#main:
default:
anonymous: ~
http_basic: ~
# activate different ways to authenticate
# http_basic: ~
# http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
# form_login: ~
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html
#access_control:
# require ROLE_ADMIN for /main*
# - { path: ^/main, roles: ROLE_ADMIN }
secured_area:
anonymous: ~
oauth:
resource_owners:
google: "/login/check-google"
login_path: /login
use_forward: false
failure_path: /login
oauth_user_provider:
service: my.oauth_aware.user_provider.service
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
你能过去你的security.yml文件吗? 该错误表示你有一个问题下security.firewalls.secured_area.oauth –
我粘贴,你能帮我。谢谢 – Darius92