Hi All
My application's use case is to
- Find all the users in my GSuite domain, and
- For each user, list all the files in his/her drive.
I have a Service Account with Domain-wide delegation enabled.
To fetch the list of users, I created a JWT with the sub as 'admin@mydomain.com', exchanged it for an access token, and fetched the users via admin API https://admin.googleapis.com/admin/directory/v1/users
When I am trying to use this same token to call https://www.googleapis.com/drive/v3/files
endpoint (with q as 'user1@mydomain.com' in owners), nothing is returned.
Is this even allowed, or do I need to create a new JWT but this time with the sub as 'user1@mydomain.com' and use that token to call https://www.googleapis.com/drive/v3/files
or are there any other configurations to be enabled for the service account such that admin token can be used for fetching data of all the users in the organization.
FYI, I did not provision the Service account; it was done by my company admin, so please let me know what extra I need to check with them.