OAuth Google API for Java unable to impersonate user

后端 未结 2 746
感情败类
感情败类 2020-12-15 11:19

I would like to impersonate a user and add files to the users Google Drive on their behalf from a server process. I\'ve setup a service account and can successfully access

相关标签:
2条回答
  • 2020-12-15 11:33

    Get your admin to add scopes to xxxxx.apps.googleusercontent.com via admin panel:

    I added the following to work on spreadsheets:


    https://www.googleapis.com/auth/drive
    https://docs.google.com/feeds
    https://spreadsheets.google.com/feeds

    delegate oAuth permissions scope

    0 讨论(0)
  • 2020-12-15 11:43

    I found a similar question as mine: Can a Google Apps Admin manage users files with Drive SDK? to mine which has helped me figure out the answer.

    The cPanel documentation is a little misleading as it refers to enabling the consumer key and then adding the domain to the Manage API client access screen. This appears to be valid for the gdata api and not the new Google Drive api. By adding the client id as suggested in the other question and granting access to the Drive scope I'm now able to impersonate a user.

    0 讨论(0)
提交回复
热议问题