管理 Google Workspace API 的凭据
凭据用于从 Google 的授权服务器获取访问令牌,以便您的应用可以调用 Google Workspace API。对于 Google Workspace API,您可以管理 OAuth 2.0 凭据和服务账号凭据。
查看凭据
如需查看为所有 Google Workspace API 或单个 Google Workspace API 启用的凭据的列表,请执行以下操作:
在 Google Cloud 控制台中,依次点击“菜单”图标 menu
> 更多产品
> Google Workspace
> 凭据。
前往 Google Workspace
如需选择单个 Google Workspace API,请点击 All Google Workspace APIs(所有 Google Workspace API),然后选择一个 API。
修改凭据
创建凭据后,您可以修改凭据的某些方面。例如,对于 OAuth 2.0 客户端 ID,您可以修改 Google Cloud 控制台中显示的名称或重置客户端密钥。对于服务账号,您可以修改名称和说明。
在 Google Cloud 控制台中,依次点击“菜单”图标 menu
> 更多产品
> Google Workspace
> 凭据。
前往 Google Workspace
如需修改凭据,请点击“修改”图标 edit。
进行更改,然后点击保存。
重置客户端密钥
客户端密钥应仅供应用和授权服务器知晓。
在 Google Cloud 控制台中,依次点击“菜单”图标 menu
> 更多产品
> Google Workspace
> 凭据。
前往 Google Workspace
点击 OAuth 2.0 客户端 ID 旁边的“修改”图标 edit。
点击重置密文。
复制该 Secret,并使用此值更新应用。
停用服务账号
您停用服务账号后,应用将无法再通过该服务账号访问 Google Cloud 资源。如果您停用了某个服务账号,日后可以重新启用。
在 Google Cloud 控制台中,依次点击“菜单”图标 menu
> 更多产品
> Google Workspace
> 凭据。
前往 Google Workspace
点击服务账号旁边的“修改”图标 edit。
点击停用服务账号,然后点击停用。
删除客户端 ID 或服务账号
您删除客户 ID 或服务账号后,应用将无法再通过该客户 ID 或服务账号访问 Google Cloud 资源。如果您删除客户端 ID 或服务账号,此操作是永久性的,并且无法恢复凭据。
在 Google Cloud 控制台中,依次点击“菜单”图标 menu
> 更多产品
> Google Workspace
> 凭据。
前往 Google Workspace
点击凭据旁边的“删除”图标 delete,然后点击删除。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-08。
[null,null,["最后更新时间 (UTC):2025-04-08。"],[[["Google Workspace credentials, including OAuth 2.0 and service accounts, are used to obtain access tokens for your app to interact with Google Workspace APIs."],["You can manage your Google Workspace credentials—view, edit, reset client secrets, turn off service accounts, and delete credentials—in the Google Cloud console."],["Deleting credentials permanently removes application access to Google Cloud resources through that credential and cannot be undone."],["For security, the client secret of an OAuth 2.0 Client ID should only be known by the application and the authorization server."]]],["Credentials, like OAuth 2.0 and service accounts, enable apps to access Google Workspace APIs. To manage them, navigate to **Google Workspace** \u003e **Credentials** in the Google Cloud console. Here, you can view credentials for all or individual APIs. Editing allows changes to names and descriptions or resetting client secrets. Service accounts can be disabled or deleted, permanently revoking app access. Similarly, deleting client IDs is permanent. Finally, credentials can be reset to get new access tokes.\n"]]