CakePHP OAuth with Google

前端 未结 3 1468
夕颜
夕颜 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'));
    

提交回复
热议问题