mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 09:51:36 +00:00
catch unauthorized client and show service account instructions
This commit is contained in:
2
gam.py
2
gam.py
@@ -614,7 +614,7 @@ def buildGAPIServiceObject(api, act_as=None, soft_errors=False):
|
||||
try:
|
||||
return googleapiclient.discovery.build(api, version, http=http)
|
||||
except oauth2client.client.AccessTokenRefreshError, e:
|
||||
if e.message == u'access_denied':
|
||||
if e.message in [u'access_denied', u'unauthorized_client: Unauthorized client or scope in request.']:
|
||||
print u'Error: Access Denied. Please make sure the Client Name:\n\n%s\n\nis authorized for the API Scope(s):\n\n%s\n\nThis can be configured in your Control Panel under:\n\nSecurity -->\nAdvanced Settings -->\nManage third party OAuth Client access' % (SERVICE_ACCOUNT_CLIENT_ID, ','.join(scope))
|
||||
sys.exit(5)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user