管理 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。"],[[["\u003cp\u003eGoogle Workspace credentials, including OAuth 2.0 and service accounts, are used to obtain access tokens for your app to interact with Google Workspace APIs.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage your Google Workspace credentials—view, edit, reset client secrets, turn off service accounts, and delete credentials—in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eDeleting credentials permanently removes application access to Google Cloud resources through that credential and cannot be undone.\u003c/p\u003e\n"],["\u003cp\u003eFor security, the client secret of an OAuth 2.0 Client ID should only be known by the application and the authorization server.\u003c/p\u003e\n"]]],["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"],null,["# Manage credentials for Google Workspace APIs\n\nCredentials are used to obtain an access token from Google's authorization\nservers so your app can call Google Workspace APIs. For\nGoogle Workspace APIs, you can manage OAuth 2.0 and service account\ncredentials.\n\nView credentials\n----------------\n\nTo see a list of credentials enabled for all Google Workspace APIs or an\nindividual Google Workspace API, do the following:\n\n1. In the Google Cloud console, click Menu\n menu\n \\\u003e **More products**\n \\\u003e **Google Workspace**\n \\\u003e **Credentials**.\n\n [Go to Google Workspace](https://console.cloud.google.com/workspace-api)\n2. To select an individual Google Workspace API, click **All Google\n Workspace APIs**, then select an API.\n\nEdit credentials\n----------------\n\nAfter you create credentials, you can edit some aspects of a credential. For\nexample, for OAuth 2.0 client IDs, you can edit the name that is shown in\ntheGoogle Cloud console or reset the client secret. For service accounts, you\ncan edit the name and description.\n\n1. In the Google Cloud console, click Menu\n menu\n \\\u003e **More products**\n \\\u003e **Google Workspace**\n \\\u003e **Credentials**.\n\n [Go to Google Workspace](https://console.cloud.google.com/workspace-api)\n2. To edit a credential, click Edit edit.\n\n3. Make your changes and then click **Save**.\n\nReset client secret\n-------------------\n\nThe client secret should only be known to the application and the authorization\nserver.\n\n1. In the Google Cloud console, click Menu\n menu\n \\\u003e **More products**\n \\\u003e **Google Workspace**\n \\\u003e **Credentials**.\n\n [Go to Google Workspace](https://console.cloud.google.com/workspace-api)\n2. Next to an OAuth 2.0 Client ID, click Edit edit.\n\n3. Click **Reset Secret**.\n\n4. Copy the secret and update the application with this value.\n\nTurn off a service account\n--------------------------\n\nWhen you turn off a service account, applications no longer have access to the\nGoogle Cloud resources through that service account. If you turn off a service\naccount, you can turn it back on later.\n\n1. In the Google Cloud console, click Menu\n menu\n \\\u003e **More products**\n \\\u003e **Google Workspace**\n \\\u003e **Credentials**.\n\n [Go to Google Workspace](https://console.cloud.google.com/workspace-api)\n2. Next to a service account, click Edit edit.\n\n3. Click **Disable service account** and then click **Disable.**\n\nDelete a client ID or service account\n-------------------------------------\n\nWhen you delete a client ID or a service account, applications no longer have\naccess to the Google Cloud Resources through that client ID or service\naccount. If you delete a client ID or service account, this deletion is\npermanent and the credentials can't be restored.\n\n1. In the Google Cloud console, click Menu\n menu\n \\\u003e **More products**\n \\\u003e **Google Workspace**\n \\\u003e **Credentials**.\n\n [Go to Google Workspace](https://console.cloud.google.com/workspace-api)\n2. Next to a credential, click Delete\n delete and then click **Delete**.\n\nNext steps\n----------\n\n- [Learn about authentication \\& authorization](/workspace/guides/auth-overview).\n- [Create access credentials](/workspace/guides/create-credentials)."]]