diff --git a/src/gam.py b/src/gam.py index 33d83f3c..8eebc0f0 100755 --- a/src/gam.py +++ b/src/gam.py @@ -8712,7 +8712,26 @@ def OAuthInfo(): print u'Google Apps Admin: Unknown' def doRequestOAuth(): - pass + admin_email = raw_input(u'Please enter your admin email address: ') + apis = API_VER_MAPPING.keys() + apis.remove(u'oauth2') + for api in apis: + version = getAPIVer(api) + if api in [u'directory', u'reports', u'datatransfer']: + api = u'admin' + http = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL], + cache=GC_Values[GC_CACHE_DIR]) + try: + service = googleapiclient.discovery.build(api, version, http=http, cache_discovery=False) + except googleapiclient.errors.UnknownApiNameOrVersion: + service = getServiceFromDiscoveryDocument(api, version, http) + print u'%s: %s' % (service._rootDesc['title'], service._rootDesc['description']) + for scope in service._rootDesc[u'auth'][u'oauth2'][u'scopes'].items(): + scope_value = scope[0] + scope_description = scope[1][u'description'] + print u' %s\n %s' % (scope_value, scope_description) + print + print def batch_worker(): while True: