使用Google API目录服务的范围是什么

时间:2013-08-14 22:42:31

标签: google-api google-api-php-client google-admin-sdk

我已经使用了许多Google API服务,例如日历和Google+个人资料,但使用目录服务却很困难。

这是我在local_config中声明的范围 - 一切都在工作,直到我添加了最后一行......

 // Definition of service specific values like scopes, oauth token URLs, etc
'services' => array(
    'analytics' => array('scope' => 'https://www.googleapis.com/auth/analytics.readonly'),
    'calendar' => array(
        'scope' => array(
            "https://www.googleapis.com/auth/calendar",
            "https://www.googleapis.com/auth/calendar.readonly",
        )
    ),
    'books' => array('scope' => 'https://www.googleapis.com/auth/books'),
    'latitude' => array(
        'scope' => array(
            'https://www.googleapis.com/auth/latitude.all.best',
            'https://www.googleapis.com/auth/latitude.all.city',
        )
    ),
    'moderator' => array('scope' => 'https://www.googleapis.com/auth/moderator'),
    'oauth2' => array(
        'scope' => array(
            'https://www.googleapis.com/auth/userinfo.profile',
            'https://www.googleapis.com/auth/userinfo.email',
        )
    ),
    'plus' => array('scope' => 'https://www.googleapis.com/auth/plus.login'),
    'siteVerification' => array('scope' => 'https://www.googleapis.com/auth/siteverification'),
    'tasks' => array('scope' => 'https://www.googleapis.com/auth/tasks'),
    'urlshortener' => array('scope' => 'https://www.googleapis.com/auth/urlshortener'),
    'directory' => array('scope' => 'https://www.googleapis.com/auth/admin')

我尝试了几种不同的组合,但似乎没有任何效果 - 这是我得到的错误......

    Some requested scopes were invalid. 
{valid=[https://www.googleapis.com/auth/tasks, 
https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/calendar.readonly, https://www.googleapis.com/auth/userinfo.profile, 
https://www.googleapis.com/auth/userinfo.email], invalid=[https://www.googleapis.com/auth/admin]}

我正在尝试提取群组列表,但稍后我还需要其他管理员SD功能。

谢谢!如果我需要添加更多详细信息,请与我们联系。

1 个答案:

答案 0 :(得分:2)