Learn about authentication and authorization  |  Google Workspace  |  Google for Developers (2024)

  • Home
  • Google Workspace
  • Guides
Stay organized with collections Save and categorize content based on your preferences.

Authentication and authorization are mechanisms used to verify identity andaccess to resources, respectively. This document identifies key terms that youshould know before implementing authentication and authorization in your app.

Authentication identifies who is making the request.Authorization identifies what resources the requestor can accessand what level of access that they have. Authentication is a prerequisite forauthorization. You can't determine what resources to access without firstestablishing the identity of the requestor. For a more detailed definition,see theImportant terminology section.

Consider the following simplified example of a hotel reservation. When youarrive at the hotel, the front desk clerk requests your ID to verify yourreservation. Your ID authenticates you to the hotel. The front desk clerkgives you a hotel key. This key gives you access to certain resources at thehotel such as your hotel room, the gym, and the business center. The hotelkey authorizes you to access those resources.

Process overview

The following diagram shows the high-level steps of authentication andauthorization for Google Workspace APIs:

Learn about authentication and authorization | Google Workspace | Google for Developers (3)
  1. Configure your Google Cloud project and app: Duringdevelopment, you register your app in the Google Cloud console, definingauthorization scopes and access credentials to authenticate your app with anAPI key, end user credential, or service account credential.

  2. Authenticate your app for access: When your app runs, the registeredaccess credentials are evaluated. If your app is authenticating as an enduser, a sign-in prompt might be displayed.

  3. Request resources: When your app needs access to Google resources, itasks Google using the relevant scopes of access you previously registered.

  4. Ask for user consent: If your app is authenticating as an end user,Google displays the OAuth consent screen so the user can decide whether togrant your app access to the requested data.

  5. Send approved request for resources: If the user consents to the scopesof access, your app bundles the credentials and the user-approved scopes ofaccess into a request. The request is sent to the Google authorization serverto obtain an access token.

  6. Google returns an access token: The access token contains a list ofgranted scopes of access. If the returned list of scopes is more limited thanthe requested scopes of access, your app disables any features limited by thetoken.

  7. Access requested resources: Your app uses the access token from Google toinvoke the relevant APIs and access the resources.

  8. Get a refresh token (optional): If your app needs access to a Google APIbeyond the lifetime of a single access token, it can obtain a refresh token.

  9. Request more resources: If additional access is needed, your app asks theuser to grant new scopes of access, resulting in a new request to get anaccess token (steps 3–6).

Important terminology

Following is a list of terms related to authentication and authorization:

Authentication

The act of ensuring that a principal, which can be a user or an app actingon behalf of a user, is who they say they are. When writing Google Workspaceapps, you should be aware of these types of authentication:

User authentication
The act of a user authenticating (signing in) to your app. Userauthentication is usually carried out through a signing in process in whichthe user uses a username and password combination to verify their identityto the app. User authentication can be incorporated into an app usingSign In With Google.
App authentication
The act of an app authenticating directly to Google services on behalf ofthe user running the app. App authentication is usually carried out usingpre-created credentials in your app's code.
Authorization

The permissions or "authority" the principal has to access data or performoperations. The act of authorization is carried out through code you write inyour app. This code informs the user that the app wishes to act on their behalfand, if allowed, uses your app's unique credentials to obtain an access tokenfrom Google used to access data or perform operations.

Credential

A form of identification used in software security. In terms ofauthentication, a credential is often a username and password combination. Interms of authorization for Google Workspace APIs, a credential is usually someform of identification, such as a unique secret string, known only between theapp developer and the authentication server. Google supports theseauthentication credentials: API key, OAuth 2.0 Client ID,and service accounts.

API key
The credential used to request access to public data, such as dataprovided using the Maps API or Google Workspace files shared using the"Anyone on the Internet with this link" setting withinGoogle Workspace sharing settings.
OAuth 2 client ID
The credential used to request access to user-owned data. This is theprimary credential used when requesting access to data usingGoogle Workspace APIs. This credential requires user consent.
Client secret
A string of characters that should only be known by your application and theauthorization server. The client secret protects the user's data by onlygranting tokens to authorized requestors. You should never include yourunencrypted client secret in your app. We recommend storing the client secretsecurely. For more information, seeHandle client credentials securely.
Service account keys
Used by service accounts to gain authorization to a Google service.
Service account
A credential used for server-to-server interactions, such as a facelessapp that runs as a process to access some data or perform some operation.Service accounts are usually used to access cloud-based data and operations.However, when used with domain-wide delegation of authority, theycan be used to access user data.
Scope

An OAuth 2.0 URI string that defines a level of access to resources or actionsgranted to an app. For Google Workspace, authorization scope URIs contain theGoogle Workspace app name, what kind of data it accesses, and the level ofaccess. Users of your app can review requested scopes and choose what access togrant, then Google's authentication server returns permitted scopes to yourapp in an access token. For more details, refer toHow to choose scopes for your app.

Authorization server

Google's server for granting access, using an access token, to an app'srequested data and operations.

Authorization code

A code sent from the authorization server used to obtain an accesstoken. A code is only needed when your application type is a web server app oran installed app.

Access token

A token granting access to a Google Workspace API. A single access token cangrant varying degrees, known as scopes, of access to multiple APIs. Your app'sauthorization code requests access tokens and uses them to invokeGoogle Workspace APIs.

Resource server

The server hosting the API that your app wants to call.

OAuth 2.0 framework

A standard that your app can use to provide it with “secure delegated access”or access to data and operations on behalf of the app's user. The authenticationand authorization mechanisms you use in your app represent your implementationof the OAuth 2.0 framework.

Principal

An entity, also known as an identity, that can be granted access to aresource. Google Workspace APIs support two types of principals: user accountsand service accounts. For more details, refer toPrincipals.

Data type

In the context of authentication and authorization, data type refers to theentity that owns the data that your app is trying to access. There are threedata types:

Public domain data
Data accessible by anyone, such as some Google maps data. This data isusually accessed using an API key.
End-user data
Data belonging to a specific end user or group, such as a specific user'sGoogle Drive files. This data type is usually accessed using an OAuth 2client ID or service account.
Cloud data
Data owned by a Google Cloud project. This data type is usually accessed by aservice account.
User consent

An authorization step requiring the user of your app to authorize the appto access data and perform operations on the user's behalf.

Application type

The type of app you are going to create. When creating credentials usingthe Google Cloud console, you are asked to select your application type.Application types are: Web application (JavaScript), Android, Chrome app, iOS,TVs and Limited Input devices, Desktop app (also called an "installed app"),and Universal Windows Platform (UWP).

Service account

A special type of Google account intended to represent a non-human user thatneeds to authenticate and be authorized to access data. Your application assumesthe identity of the service account to call Google APIs, so that the usersaren't directly involved. By themselves, service accounts cannot be usedto access user data; data customarily accessed using Workspace APIs. However,a service account can access user data by implementing domain-wide delegationof authority. For more details, refer toUnderstanding service accounts.

Domain-wide delegation of authority

An administration feature that can authorize an application to access userdata on behalf of users in the Google Workspace organization. Domain-widedelegation can be used to perform admin-related tasks on user data. To delegateauthority this way, Google Workspace administrators use service accounts withOAuth 2.0. Because of the power of this feature, only super admins can enabledomain-wide delegation of authority. For more details, refer toDelegating domain-wide authority to a service account.

Next step

Configure your app's OAuth consent screento ensure users can understand and approve what access your app has to theirdata.

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 2024-09-06 UTC.

Learn about authentication and authorization  |  Google Workspace  |  Google for Developers (2024)

FAQs

How to become a Google Workspace developer? ›

5 steps to get started
  1. Create a Google Cloud project for your Google Workspace app, extension, or integration.
  2. Enable the APIs you want to use in your Google Cloud project.
  3. Learn how authentication and authorization works when developing for Google Workspace.

What is authentication and authorization in web development? ›

Authentication ensures user identity, while authorization sets access permissions. Implement, test, and maintain robust systems against breaches. Multi-factor authentication reduces account compromise. Role-Based Access Control (RBAC) and Permission-Based Access Control (PBAC) are widely adopted models.

Is OAuth2 authentication or authorization? ›

OAuth 2.0 is an authorization protocol and NOT an authentication protocol. As such, it is designed primarily as a means of granting access to a set of resources, for example, remote APIs or user data.

How to set up authentication and authorization? ›

How do I implement user authentication and authorization features in my web application?
  1. Choose an authentication method. ...
  2. Set up a user database. ...
  3. Create registration and login forms. ...
  4. Implement authentication logic. ...
  5. Include authorization logic. ...
  6. Use security measures.

How much does it cost to get Google Workspace certified? ›

With a registration fee of $75 and about two hours of education and an exam, one can show productivity and knowledge on most Google products on their resume.

What is the salary of developer expert in Google? ›

The estimated total pay range for a Software Developer at Google is ₹10L–₹30.0L per year, which includes base salary and additional pay. The average Software Developer base salary at Google is ₹16.0L per year.

Is JWT authentication or authorization? ›

These tokens are typically used for authentication and authorization, as they can contain information that verifies the identity of a user, and their permissions. In terms of authentication, the information stored in the JWT is used to help servers establish trust between an unknown client and themselves.

Why is it a bad idea to use OAuth 2.0 for authentication? ›

OAuth2 is not an authentication (login) protocol!

The purpose of OAuth2 Tokens is to authorize requests at a first-party server (or API). If the third party uses the OAuth2 Access Token as proof of authentication, an attacker could easily impersonate a legitimate user.

Is Google OAuth2 free? ›

For the basic information like name, email and user ID is free for it is within the free tier of Oauth. However, there might be some indirect costs like free tier limits which have a limit on the number of requests you can make. Exceeding these limits might require a paid plan.

Which comes first, authentication or authorization? ›

Which Comes First, Authentication or Authorization? Authentication and authorization both rely on identity. As you cannot authorize a user or service before identifying them, authentication always comes before authorization.

How to create an API with authentication? ›

  1. #1 API Key (identification only) One of the easiest ways to identify an API client is by using an API key. ...
  2. #2 OAuth2 token. OAuth2 is a comprehensive industry standard that is widely used across API providers. ...
  3. #3 External token or assertion. ...
  4. #4 Token Exchange. ...
  5. #5 Identity facade for 3 legged OAuth.
Feb 9, 2023

What is the difference between authentication and authorization API? ›

In simple terms, authentication is the process of verifying who a user is, while authorization is the process of verifying what they have access to. Comparing these processes to a real-world example, when you go through security in an airport, you show your ID to authenticate your identity.

How can I become a Google developer? ›

In order to get access to the application form, you need to be referred by an existing Expert or a Googler. You may have been contacted by someone who considers referring you already. The application form will ask about your experience, community contributions and your motivation to join the program.

Can I earn money from Google Workspace? ›

You'll receive a cash payout for every new eligible user that you refer to Google Workspace. Google Workspace has three editions that are available for customers to sign-up online: Starter, Standard, and Plus. You will be rewarded based on the editions that you refer.

How do I become a Google Workspace administrator? ›

About this certification exam

Review the online testing requirements. b) Take the onsite-proctored exam at a testing center. Locate a test center near you. Recommended experience: 3+ years of industry experience including 1+ year Google Workspace (formerly G Suite) administration experience.

How much does Google developer license cost? ›

How to create a Google Play Developer account to submit your Android app. A Google Play Developer account is required to submit your app, along with a $25 one-time registration fee.

Top Articles
Is Getting In Someone's Face Considered Assault? | Blass Law PLLC
8 Ways to Craft A Business with Spoonflower
Farepay Login
Wisconsin Women's Volleyball Team Leaked Pictures
Gore Videos Uncensored
35105N Sap 5 50 W Nit
Buckaroo Blog
Southland Goldendoodles
Camstreams Download
Voyeuragency
อพาร์ทเมนต์ 2 ห้องนอนในเกาะโคเปนเฮเกน
Help with Choosing Parts
104 Whiley Road Lancaster Ohio
Viprow Golf
Dr Adj Redist Cadv Prin Amex Charge
Watch The Lovely Bones Online Free 123Movies
Aldine Isd Pay Scale 23-24
Edicts Of The Prime Designate
Zack Fairhurst Snapchat
The BEST Soft and Chewy Sugar Cookie Recipe
Isaidup
Maxpreps Field Hockey
Red Cedar Farms Goldendoodle
Raw Manga 1000
Asteroid City Showtimes Near Violet Crown Charlottesville
Scripchat Gratis
Regina Perrow
The Collective - Upscale Downtown Milwaukee Hair Salon
Anesthesia Simstat Answers
Tamil Movies - Ogomovies
Darknet Opsec Bible 2022
Revelry Room Seattle
What Is Opm1 Treas 310 Deposit
Franklin Villafuerte Osorio
Street Fighter 6 Nexus
Current Time In Maryland
Roadtoutopiasweepstakes.con
Beaver Saddle Ark
Wow Quest Encroaching Heat
Saybyebugs At Walmart
WorldAccount | Data Protection
Tryst Houston Tx
Lonely Wife Dating Club בקורות וחוות דעת משתמשים 2021
Callie Gullickson Eye Patches
116 Cubic Inches To Cc
View From My Seat Madison Square Garden
28 Mm Zwart Spaanplaat Gemelamineerd (U999 ST9 Matte | RAL9005) Op Maat | Zagen Op Mm + ABS Kantenband
Grace Charis Shagmag
Lsreg Att
4015 Ballinger Rd Martinsville In 46151
Generator für Fantasie-Ortsnamen: Finden Sie den perfekten Namen
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 5908

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.