0

I am already using a number of Google API services, such as Calendar and Google+ profiles, but using the Directory services is proving difficult.

Here is the scope I'm declaring in my local_config - everything has been working until I added the final line...

 // 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')

I have tried a few different combos, but nothing seems to work - here is the error I'm getting...

    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]}

I'm trying to pull Group listings at the moment, but I'll need other Admin sdk features later.

Thanks! Let me know if I need to add any more details.

Aaron
  • 98
  • 1
  • 13

1 Answers1

2

Admin SDK scopes are listed at:

https://developers.google.com/admin-sdk/directory/v1/guides/authorizing

Jay Lee
  • 13,415
  • 3
  • 28
  • 59