google-apigoogle-drive-apigoogle-appsgoogle-api-java-clientgoogle-domain-api

Fetch google drive data of domain user using Java or HTTP


I am writing a program (written in java) for businesses that manages google drive data of domain users (download/read/...).

I need to authenticate once, using domain admin's credentials, get a token and refresh token, and fetch the data of all domain users.

I succeeded with doing it for the admin user itself, using google's Drive REST API

How can I manage all the domain users with one access token and refresh token?


Solution

  • In Google Apps, the admin does not have the ability to access the user's information directly.

    The way to achieve this is through a service account and domain wide delegation.

    With this approach, after the admin grants permissions to you app, the app will be able to impersonate users in the domain and perform actions on their behalf. e.g. you can access users Drive information.