Say, I want to use Google Apps Provisioning API to retrieve my domain users and synchronize them into my Google Datastore. I want this to be done at GAE Cron Job, but GAE Cron is not the logged on user and it doesn't have any credential to call Google Apps Provisioning API. Is there way to impersonate a specific user to call Google Apps Provisioning API?
Asked
Active
Viewed 189 times
1
-
1Have a look at this answer : http://stackoverflow.com/questions/12955089/is-it-possible-to-access-provisioning-api-with-service-account – voscausa Dec 27 '12 at 03:03
-
Alright, I will try for that one. Not sure if this really works. – lannyboy Dec 27 '12 at 07:31
-
Hey voscausa, thanks a lot! This method works perfect for me :) – lannyboy Dec 27 '12 at 08:37
1 Answers
0
You need to get an OAuth 2.0 token for the user you wish to impersonate and ensure that access_type=offline is set. Then with the stored refresh token, you can get a current access token for the user and perform the cron actions even without the user "present".

Jay Lee
- 13,415
- 3
- 28
- 59
-
Thanks, buddy. voscausa has a better solution for this. Anyway, thanks for your answer :) – lannyboy Dec 28 '12 at 01:44