2011-12-16 4 views
5

Facebook 용 번들 & Symfony2 앱에 대한 Twitter 승인. 그러나 Google Plus와 같은 다른 사이트는 어떻습니까? 어떤 번들도 아직 없으며 누군가가 그것을 구현하는 방법에 대한 올바른 방향을 알고 있는지 알고 싶습니다.Symfony2를 통한 Google Plus 인증

Google Plus에서 OAuth를 사용한다고 생각합니다. 그런 다음 OAuth 번들로 구현할 수 있습니까?

답변

2

KnpOAuthBundle (개발 중)을 확인할 수 있습니다. github OAuth 공급자 만 구현됩니다.

Google OAuth 2.0 제공 업체 (check this)를 구현하거나 IRC에서 이미 구현 한 사용자 일 수도 있습니다.

8

KnpOAuthBundle은 사용되지 않으며 HWIOAuthBundle을 사용하도록 권장됩니다.

HWIOAuthBundle은 Facebook, Twitter, Google, Yahoo 등 여러 OAuth 공급자를 지원하므로 모든 인증 논리를 1 묶음으로 유지할 수 있습니다. 사용법은 매우 간단합니다 : 구성 구글 자원 소유자 :

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* 

그리고 추가 라우팅 :

google_login: 
    pattern: /login/google 
hwi_oauth_redirect: 
    resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml" 
    prefix: /connect 

인증 과정이 간단하게 예를 들어 /connect/*provider_name*로 사용자를 리디렉션 시작하려면 /connect/google