I am trying to get an access token for Google Service Account. Following is my code -
String SERVICE_ACCOUNT_EMAIL = \"edited@developer.gserviceaccount.com\
You need to set an admin account with:
.setServiceAccountUser(some_admin_email)
And make sure your App (with the correct scopes) is granted access in the cpanel.
Proceed to https://admin.google.com . Login and add Security control if not exists from More Controls.
Click on Security->Advance Settings->Manage ThirdParty OAuth Client Access
and check that those scopes are added(comma separated) for your xxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
service account id/client id.
You have to enable the specific api before using it inside https://console.developers.google.com/ library, to make it work with your api key. watch the video https://www.youtube.com/watch?v=s_G5CnAu69M.