CakePHP OAuth with Google

前端 未结 3 1466
夕颜
夕颜 2021-02-02 17:30

I would like to use Google OAuth in my cakePHP application to let the users login with their google account. I looked at the following component: http://code.42dh.com/oauth/ . S

相关标签:
3条回答
  • 2021-02-02 17:53

    I think the issue is the querystring in the request token url. Try the following:

    $REQUEST_TOKEN_URL = 'https://www.google.com/accounts/OAuthGetRequestToken';
    $requestToken = $this->OauthConsumer->getRequestToken('Google', $REQUEST_TOKEN_URL, 'http://mydomain.com/example/google_callback', 'GET', array('scope' => 'https://www.google.com/m8/feeds'));
    
    0 讨论(0)
  • 2021-02-02 18:12

    You forgot the Public API Access key and url referers allowed to connect with your cliend ID and secret key...

    Create a public API access, and add it in your settings.

    0 讨论(0)
  • 2021-02-02 18:13

    Check here for an updated CakePHP 3 tutorial and plugin:

    • Login with Google Oauth2 in CakePHP 3 using CakeDC/Users Plugin
    0 讨论(0)
提交回复
热议问题