The documentation is a little unclear on this. Can I actually do this? The only examples I've seen so far are from the Google documentation that show it using the GoogleAuthorizationCodeFlow class to gain authorization. I've seen a few examples of using the Service Account to update and retrieve a list of users, but nothing for creating. Is this possible? If so, does anyone know of any examples floating around? I can't seem to find anything that addresses it.
相关问题
- gdata Unknown authorization header - started 12/11
- Using nextpagetoken to pull more than 500 results
- Google Drive SDK System.Net.Http.Primitives Versio
- Google API java client - pageSize
- Reports API 503 Backend Error
相关文章
- How to save google map in android ?and How to use
- Creating a group with Admin SDK Directory API in G
- Create users using Service Account with Google Adm
- Google Drive API - too slow.
- login Google account in webview using account mana
- How to get more than 100 results from Google Custo
- How to correctly obtain user's Calendar events
- Access Not Configured Android Google API Key
You can follow the steps outlined in the following API docs page to create the service account and perform a domain wide delegation of authority, please bear in mind you need the email address of a domain administrator which the service account can act on their behalf:
https://developers.google.com/admin-sdk/directory/v1/guides/delegation
The page includes a Java example of how to instantiate a com.google.api.services.admin.directory.Directory object using the service account and private key created on the Google Developers Console. Then use the example I've provided in this answer to create the users:
Create gmail account for a domain using Google Admin SDK Directory API in Java