We have bundles for Facebook & Twitter authorization for a Symfony2 app. But what about other sites like Google Plus? There isn't any bundle yet, and I would like to know if someone knows about the right direction to how to implement it.
I think Google Plus uses OAuth. Could it be then implemented with a OAuth bundle?
KnpOAuthBundle is deprecated and recommends using HWIOAuthBundle.
HWIOAuthBundle supports several OAuth providers such as Facebook, Twitter, Google, Yahoo, etc. So you can keep all your authentication logic in 1 bundle. Usage is very easy: configure google resource owner:
hwi_oauth:
resource_owners:
google:
type: google
client_id: *client_id*
client_secret: *client_secret
scope: "https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
firewall_name: *main firewal name*
And add routings:
google_login:
pattern: /login/google
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect
To start authentication process simply redirect user to /connect/*provider_name*
, e.g. /connect/google
You can check the KnpOAuthBundle (under development) - only the github OAuth provider is implemented though.
You could implemented your own Google OAuth 2.0 Provider (check this) or ask out on IRC, maybe somebody already implemented it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With