How can I access user info on a domain without the

2020-04-14 07:25发布

问题:

I have written an application that I have listed in the Google Marketplace. I am trying to get my app to use the Directory API (part of the Admin SDK). According to the documentation here: https://developers.google.com/admin-sdk/directory/v1/guides/prerequisites, this will require anyone who installs my app to enable API access.

The only scope I need is:

https://www.googleapis.com/auth/admin.directory.user.readonly

Is there any way to access the above scope without requiring API access to be enabled? All I am ultimately trying to do is import users from a domain into my app so that they do not have to visit my app to have an account.

I am trying to avoid having to have the domain administrator enable API access. I have also seen other apps that require the same exact scope as I do that seem to work without requiring API access. I'd be willing to drop back to the older, deprecated Google Data APIs, but I don't think I can even register an app to use them.

回答1:

This is not possible today. You have you have guidance in your app to remind the admin to turn this on.

We understand this is suboptimal for both admins (expecting that authorizing an app should give it access) and developers (needing to write unnecessary code to handle this). We are looking into improving this flow but not specific plans on launch yet.