Search code examples
google-apigoogle-apps

How to push authorized APIs scope into Google ManageOath through APIs using admin creds


In Google Developer, I have created one Service Account OAuth2.0 project. To access certain APIs using Service Account, I need to manually push authorized APIs into ManageOauthClients (https://admin.google.com//AdminHome?chromeless=1#OGX:ManageOauthClients).

Lets say I want to push these scopes through some APIs.

Considering I have Admin user credentials or valid AccessToken/RefreshToken generated from web oauth2.0 for some set of APIs, Is there a way I can push some other authorized APIs scope for my service account client id into ManageOauthClients?


Solution

  • There is no programmatic way for a Google Apps admin to authorize a Service Account Client ID. You have two options:

    1. Give the admin instructions on how to login to the admin console and add the Client ID and scopes.

    2. Publish your app on the Google Apps Marketplace. Published apps offer a workflow through which admins can install your app and authorize your Service account to access the scopes.