Zend oauth范围适用于Google个人资料

时间:2012-07-17 10:25:46

标签: zend-framework oauth

有人可以告诉我,我将使用zend oauth php获取谷歌用户帐户的个人资料图片的范围

require_once 'Zend/Oauth/Consumer.php';
        $SCOPES = array(
            'https://www.googleapis.com/auth/userinfo#email',
            'https://mail.google.com/',
            'http://www.google.com/calendar/feeds/',
            'https://www.google.com/m8/feeds/'
        );

虽然我给https://www.googleapis.com/auth/userinfo#profile,但是它会抛出错误

非常感谢任何帮助

2 个答案:

答案 0 :(得分:0)

userinfo范围的正确名称为:

https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile

我认为OAuth 2.0 Playground提供了有关Google OAuth范围的最完整概述。

答案 1 :(得分:0)

尝试一段时间而不是英镑符号。我成功地在https://www.googleapis.com/auth/userinfo.profile的OAuth 1游乐场验证了http://googlecodesamples.com/oauth_playground/。如果这不起作用,请将您的请求与操场上的等效请求进行比较。