我安裝HWIOAuthBundle和所做的一切,因爲它是在這裏說(HWIOAuthBundle&FOSUserBundle整合)資源擁有者: https://gist.github.com/danvbe/4476697沒有名爲「谷歌」
但是當我嘗試去這裏我有這樣的錯誤: 「/登錄/谷歌「
沒有資源所有者的名稱'谷歌'。
和我有同樣的errror與其他API:雅虎,LinkedIn,windows_live
我不知道爲什麼,因爲我已經完成了好security.yml:
jms_security_extra:
secure_all_services: false
expressions: true
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
fos_userbundle:
id: fos_user.user_provider.username_email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
form_login:
provider: fos_userbundle
remember_me: true
csrf_provider: form.csrf_provider
login_path: /login
check_path: /login_check
remember_me:
key: %secret%
anonymous: true
logout: true
oauth:
resource_owners:
yahoo: "/login/check-yahoo"
google: "/login/check-google"
windows_live: "/login/check-windows_live"
linkedin: "/login/check-linkedin"
login_path: /login
failure_path: /login
oauth_user_provider:
service: my_user_provider
logout:
path: /logout
target:/
login:
pattern: ^/login$
security: false
remember_me:
key: "%secret%"
lifetime: 31536000 # 365 days in seconds
path:/
domain: ~ # Defaults to the current domain from $_SERVER
access_control:
- { path: ^/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/profile, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/(search|contact|myprofile), roles: ROLE_USER }
也config.yml:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: "@MyprojectUserBundle/Resources/config/services.yml" }
#[..]
fos_user:
db_driver: orm
firewall_name: main
user_class: Uvaluo\UserBundle\Entity\User
registration:
form:
type: uvaluo_user_registration
confirmation:
enabled: true
template: FOSUserBundle:Registration:email.txt.twig
hwi_oauth:
connect:
account_connector: my_user_provider
firewall_name: main
fosub:
username_iterations: 30
properties:
yahoo: yahoo_id
google: google_id
windows_live: windows_live_id
linkedin: linkedin_id
resource_owners:
any_name:
type: yahoo
client_id: X
client_secret: X
any_name:
type: google
client_id: X
client_secret: X
scope: "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
any_name:
type: windows_live
client_id: X
client_secret: X
any_name:
type: linkedin
client_id: X
client_secret: X
scope: r_basicprofile
我已經設置了所有資源的所有者,所以我不知道爲什麼我得到這個錯誤。