Stay organized with collections Save and categorize content based on your preferences.
Credentials are used to obtain an access token from Google's authorization servers so your app can call Google Workspace APIs. This guide describes how to choose and set up the credentials your app needs.
For definitions of terms found on this page, see Authentication and authorization overview.
Choose the access credential that is right for youThe required credentials depends on the type of data, platform, and access methodology of your app. There are three types of credential types available:
Use case Authentication method About this authentication method Access publicly available data anonymously in your app. API keys Check that the API that you want to use supports API keys before using this authentication method. Access user data such as their email address or age. OAuth client ID Requires your app to request and receive consent from the user. Access data that belongs to your own application or access resources on behalf of Google Workspace or Cloud Identity users through domain-wide delegation. Service account When an app authenticates as a service account, it has access to all resources that the service account has permission to access. Note: To be guided on how to choose a credential, see Choose the right authentication method for your use case in the Google Cloud console or use the Help me choose option in the Google Cloud console. API key credentialsAn API key is a long string containing upper and lower case letters, numbers, underscores, and hyphens, such as AIzaSyDaGmWKa4JsXZ-HjGw7ISLn_3namBGewQe
. This authentication method is used to anonymously access publicly-available data, such as Google Workspace files shared using the "Anyone on the Internet with this link" sharing setting. For more details, see Using API keys.
To create an API key:
To authenticate end users and access user data in your app, you need to create one or more OAuth 2.0 Client IDs. A client ID is used to identify a single app to Google's OAuth servers. If your app runs on multiple platforms, you must create a separate client ID for each platform.
Choose your application type for specific instructions about how to create an OAuth client ID:
Web applicationThe newly created credential appears under OAuth 2.0 Client IDs.
Note the Client ID. Client secrets aren't used for Web applications.
AndroidManifest.xml
file.The newly created credential appears under "OAuth 2.0 Client IDs."
Info.plist
file.The newly created credential appears under "OAuth 2.0 Client IDs."
The newly created credential appears under "OAuth 2.0 Client IDs."
The newly created credential appears under "OAuth 2.0 Client IDs."
The newly created credential appears under "OAuth 2.0 Client IDs."
The newly created credential appears under "OAuth 2.0 Client IDs."
A service account is a special kind of account used by an application, rather than a person. You can use a service account to access data or perform actions by the robot account, or to access data on behalf of Google Workspace or Cloud Identity users. For more information, see
Understanding service accounts.
Create a service account Google Cloud consolegcloud iam service-accounts create SERVICE_ACCOUNT_NAME
\
--display-name="SERVICE_ACCOUNT_NAME
"
You must assign a prebuilt or custom role to a service account by a super administrator account.
In the Google Admin console, go to Menu menu> Account > Admin roles.
Point to the role that you want to assign, and then click Assign admin.
Click Assign service accounts.
Enter the email address of the service account.
Click Add > Assign role.
You need to obtain credentials in the form of a public/private key pair. These credentials are used by your code to authorize service account actions within your app.
To obtain credentials for your service account:
Your new public/private key pair is generated and downloaded to your machine as a new file. Save the downloaded JSON file as credentials.json
in your working directory. This file is the only copy of this key. For information about how to store your key securely, see Managing service account keys.
To call APIs on behalf of users in a Google Workspace organization, your service account needs to be granted domain-wide delegation of authority in the Google Workspace Admin console by a super administrator account. For more information, see
Delegating domain-wide authority to a service account.
To set up domain-wide delegation of authority for a service account:
If you have super administrator access to the relevant Google Workspace account, click View Google Workspace Admin Console, then sign in using a super administrator user account and continue following these steps.
If you don't have super administrator access to the relevant Google Workspace account, contact a super administrator for that account and send them your service account's Client ID and list of OAuth Scopes so they can complete the following steps in the Admin console.
You're ready to develop on Google Workspace! Review the list of Google Workspace developer products and how to find help.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-08 UTC."],[[["Google Workspace APIs require credentials, which can be API keys, OAuth client IDs, or service accounts, depending on the type of access needed."],["API keys provide anonymous access to public data and are created in the Google Cloud console."],["OAuth client IDs are used for accessing user data with consent and require separate IDs for different platforms."],["Service accounts enable applications to access data or act on behalf of users and require role assignment and secure key management."],["Creating a service account involves assigning roles, generating keys, and optionally configuring domain-wide delegation for accessing user data on behalf of the application."]]],["Google uses credentials for apps to access Google Workspace APIs. Three credential types exist: API keys for public data access, OAuth client IDs for user data, and service accounts for application-owned data or delegated access. To create an API key go to the API and Services section in the Google Cloud console. Create an OAuth client ID by choosing the correct app platform and filling the required fields. Service accounts are created through IAM & Admin section of the Google Cloud console, or CLI, and allow role assignments and key generation. Domain-wide delegation can be set up in the Google Admin console to make API calls on behalf of users.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4