google-directory-api 相关问题

Google Apps和转销商管理员可以使用Directory API管理移动和Chrome操作系统设备,组,组别名,成员,组织单位,用户和用户别名。

Google 工作负载身份联合调用目录 API

我正在尝试使用 AWS 设置 Google Identity Federation,以便从 aws lambda 函数进行 admin.directory API 调用。它是用 Java 编写的。 我设置了工作负载池,创建了服务帐户并

回答 1 投票 0

如何获取用户的Google角色?

我正在使用 Google Auth 在 ASP .NET Core 5 上设置 Web 应用程序。我希望能够使用授权属性标记某些页面,以仅允许具有给定角色的用户访问。 访问方式

回答 1 投票 0

用于请求用户列表的 C# Google API 返回“badRequest”

我这几天一直在寻找这方面的信息。我相信我已正确设置与 API 相关的所有内容以供访问,但我不断收到此错误: 服务管理员有...

回答 1 投票 0

检索用户的所有组 ->Google Directory API

我正在尝试创建一个页面,我的 NGO 内的用户可以使用其 GSuite 帐户登录。他们的组成员身份将决定他们可以看到页面的哪些部分。当我年轻的时候,我...

回答 1 投票 0

来自 Google Workspace 的用户邮箱使用情况报告

我正在尝试获取基本的电子邮件使用情况报告。我们需要获取用户名及其电子邮箱的大小。下面提供的代码抛出异常 ” 我正在尝试获取基本的电子邮件使用情况报告。我们需要获取用户名及其电子邮箱的大小。下面提供的代码抛出异常 ”https://admin.googleapis.com/admin/directory/v1/users?alt=json 返回“错误请求”。详细信息:“[{'message': '错误请求', 'domain': ' global', 'reason': 'badRequest'}]">**" 就行了 users = service.users().list().execute() 完整代码如下: from __future__ import print_function import os.path import csv import io from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build # If modifying these scopes, delete the file token.json. #SCOPES = ['https://www.googleapis.com/auth/admin.directory.user.readonly'] SCOPES = ['https://admin.googleapis.com/admin/directory/v1/users'] creds = None # The file token.json stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists('token.json'): creds = Credentials.from_authorized_user_file('token.json', SCOPES) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( 'credentials.json', SCOPES) creds = flow.run_local_server(port=0) # Save the credentials for the next run with open('token.json', 'w') as token: token.write(creds.to_json()) service = build('admin', 'directory_v1', credentials=creds) print('Getting users in the domain') users = service.users().list().execute() # Create a dictionary to store the user data. user_data = {} # Iterate over the list of users and get their first name, last name, and mailbox size. for user in users["users"]: user_data[user["primaryEmail"]] = { "firstName": user["name"]["givenName"], "lastName": user["name"]["familyName"], "mailboxSize": user["storage"]["quotaUsage"], } # Open the CSV file for writing. with open("user_data.csv", "w", newline="") as f: writer = csv.writer(f) # Write the header row. writer.writerow(["email", "firstName", "lastName", "mailboxSize"]) # Iterate over the user data and write each user's data to a new row in the CSV file. for email, data in user_data.items(): writer.writerow([email, data["firstName"], data["lastName"], data["mailboxSize"]]) # Close the CSV file. f.close() 凭证正确。测试多次。正如您从示例中看到的,我尝试使用不同的范围。 我在这里做错了什么? 你错过了你的customer='my_customer': from __future__ import print_function import os.path from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build # If modifying these scopes, delete the file token.json. SCOPES = ['https://www.googleapis.com/auth/admin.directory.user'] USER_TOKEN = "token_create_user.json" CREDENTIALS = 'C:\Development\FreeLance\GoogleSamples\Credentials\Workspace-Installed-TestEverything.json' def main(): """Shows basic usage of the Admin SDK Directory API. Prints the emails and names of the first 10 users in the domain. """ creds = None # The file token.json stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists(USER_TOKEN): creds = Credentials.from_authorized_user_file(USER_TOKEN, SCOPES) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( CREDENTIALS, SCOPES) creds = flow.run_local_server(port=0) # Save the credentials for the next run with open(USER_TOKEN, 'w') as token: token.write(creds.to_json()) service = build('admin', 'directory_v1', credentials=creds) # Call the Admin SDK Directory API print('Getting the first 10 users in the domain') results = service.users().list(customer='my_customer', maxResults=10, orderBy='email').execute() users = results.get('users', []) if not users: print('No users in the domain.') else: print('Users:') for user in users: print(u'{0} ({1})'.format(user['primaryEmail'], user['name']['fullName'])) if __name__ == '__main__': main()

回答 1 投票 0

Google Directions Api 优化问题

我正在使用带有一些航路点的方向 API。问题是它没有优化,它符合我的数组的顺序,而不是最有效的顺序。 我不希望我的数组的顺序被采用

回答 1 投票 0

使用域共享联系人 API + Python 在 Google Workspace 目录中创建外部联系人

我不知道如何使用域共享联系人 API 在 Google Workspace 目录中创建(使其对所有人可见)外部联系人。 这个想法是创建一个外部联系人(目录宽度...

回答 1 投票 0

如何使用 Google Admin API 从用户帐户中删除管理员角色分配?

我需要从用户帐户列表中删除角色分配。我熟悉 Google Apps 脚本,但需要帮助制定使用 Google A 删除角色分配所需的脚本...

回答 1 投票 0

使用 Google Calendar API 为活动分配资源/房间

我正在尝试将资源分配给新的 Google 日历活动。我可以看到添加到事件的资源列在“参加者”属性下,但是当我尝试将资源添加为事件时

回答 0 投票 0

超级管理员服务帐号找不到资源日历

我正在尝试列出 Google Workspace 资源日历中的所有事件,这些事件会导致“找不到用户”或“无效模拟”,具体取决于哪个日历

回答 0 投票 0

创建用户时 SHA2-512 上的哈希函数名称无效

尝试使用库“google.golang.org/api/admin/directory/v1”从 golang 创建用户 由于文档在这里 https://developers.google.com/admin-sdk/directory/reference/rest/v1/users...

回答 2 投票 0

使用gcp admin sdk发现建立在云端的服务账号功能。

目前,我能够使用部署在服务账户中的云函数中的以下代码访问用户,该账户具有域范围的授权。但我使用的是service_account.Credentials...。

回答 1 投票 -1

目录api的gsuite服务帐户返回http 400错误:错误的请求/无效的输入

我已经开始开发一些api来在我的G Suite目录中创建用户。我遵循了服务帐户教程以及python的目录教程。我的代码非常简单,只是...

回答 1 投票 1

directory_v1始终从云函数返回403

我已按照https://developers.google.com/admin-sdk/directory/v1/guides/delegation中提到的步骤进行服务帐户具有所有必要的域范围内的委派。我希望在下面运行...

回答 1 投票 0

插入成员-代码:400,消息:缺少必填字段:成员

我有有效的json,它在Google网上论坛成员API中出错。我省略了oauth的内容,但在这里执行了代码:groupsSettings = build('groupssettings','v1',凭据=信用)file = ...

回答 1 投票 0

Google Directory API返回过时的值

我有一个奇怪的问题,大约有两个星期。我的python脚本反复(每5分钟一次)向gsuite用户询问google目录api。 A希望找到启用了2因子身份验证的用户(...

回答 2 投票 1

[G Suite管理员SDK组API订阅是否发生了更改或类似的增量API?

我有这个API调用https://developers.google.com/admin-sdk/directory/v1/reference/members/list来获取组中的成员列表。但是我还需要在相同的...中同步修改/删除的数据...

回答 1 投票 0

变量转储显示数据,但以未定义形式返回

希望这是一个“ DOH”时刻,但我不知道为什么会这样。我正在使用服务对象在Google的Directory API中获取组的成员。创建服务对象后,我...

回答 2 投票 3

权限不足:通过管理员登录时,请求在Google目录API中的身份验证范围不足

我正在使用google admin目录API使用以下API https://www.googleapis.com/admin/directory/v1/users获取所有帐户的公共信息,这是我登录时此api链接的链接...

回答 1 投票 0

未授权服务帐户尝试使用Python访问目录api时访问此资源/ api

[我们使用Python从特定的G Suite托管域中获取所有用户,但是在完成以下教程并向服务帐户授予了所有所需的访问权限后,以下代码段...

回答 1 投票 1

© www.soinside.com 2019 - 2024. All rights reserved.