Dashboard

What Is OAuth? Why Apps Ask to Connect to Your Account

OAuth is the permission slip behind every Connect with Google button. This guide reads a consent screen line by line and flags the grants to refuse.

Cecilia Iona
Cecilia Iona
Senior Editor, AI & Product
22 October 20261 min read

OAuth is the system behind the "Connect your Google account" button. It lets one app act on your account at another service, for example reading your calendar, without you ever giving that app your password. The OAuth.net site calls OAuth 2.0 "the industry-standard protocol for authorization." The key word is authorization: it decides what an app may do, and it is a separate matter from proving who you are.

OAuth as a permission slip

Think of a hotel key card. You do not hand a guest your master key. You hand them a card that opens one room until Sunday. OAuth works the same way. When you click Connect, the service asks you to approve a specific, limited permission. If you agree, it gives the app a token, which is the key card. The app uses the token, never the password.

That design is why OAuth is safer than the older habit of typing your password into a third-party tool. You can see what was granted, and you can cancel it later without changing your password.

Every consent screen has the same few parts:

  1. Who is asking. The name of the app. Check it is the app you meant to connect.

  2. What it wants. A list of permissions, called scopes. "See your calendar events" is narrower than "See, edit, share and permanently delete all calendars."

  3. Which account. Make sure you are approving with the right one, personal or work.

  4. How to undo it. Every major provider has a page listing connected apps where you can revoke access.

The line that matters most is the second one. Approve the smallest list that lets the feature work. If a note-taking tool wants your whole email archive, say no.

OAuth is not the same as logging in

Authorization and authentication are different questions. Authorization asks "what can this app do?" Authentication asks "who are you?" OAuth 2.0 answers the first. The official site lists OpenID Connect as a protocol built on top of OAuth 2.0, and that layer is what adds identity. When you press "Sign in with Google" you are usually using both together: OpenID Connect for who you are and OAuth for what the app may see.

This matters when an AI tool builds your login. Make sure it is clear which of the two you are implementing. Adding social login to an AI-built app shows the sign-in side.

The grant types in plain words

The OAuth site lists seven grant types. Each is a different way for an app to obtain a token:

Grant type

Plain meaning

Use it for

Authorization Code

The standard flow for apps with a user present

Most web apps

PKCE

An extra safeguard added to the code flow

Mobile and browser apps, and generally a good addition

Client Credentials

The app acts as itself, with no user

Server-to-server jobs

Device Code

You approve on a second device

TVs and command-line tools

Refresh Token

Gets a new token without asking you again

Staying connected

Implicit Flow

Marked legacy on the site

Avoid

Password Grant

Marked legacy on the site

Avoid

If an AI tool generates code using the two flows marked legacy, treat it as a flaw to fix. Ask for the Authorization Code flow with PKCE instead.

Where AI agents make this risky

An AI agent that connects to your accounts holds a token with real power. The danger is breadth, not the protocol itself. An agent asked to "tidy my inbox" may request permission to read, send and delete everything. Why granting an AI agent broad OAuth scopes is a mistake explains how that happens, and whether it is safe to let AI read your email gives a scope checklist for the most common case.

A habit that helps: every few months, open the connected apps page for your email, calendar and code hosting accounts, and remove anything you no longer use. How to disconnect an AI tool you stopped using lists the places access hides.

What to check before you approve

  • The app name and publisher match what you expected.

  • The scopes are the minimum the feature needs.

  • You are signed into the intended account.

  • You know where to revoke the access later.

  • The request came from a button you clicked, not from a message urging you to approve quickly.

For the wider risks around agents and accounts, the AI risks guide for builders is a good map.

FAQ

Is OAuth the same as OpenID Connect?

No. OAuth 2.0 handles permission. OpenID Connect is built on top of it and adds identity, which is what makes sign-in possible.

Does OAuth share my password with the app?

No. The app gets a token with limited permissions. Your password stays with the service.

How do I revoke an OAuth connection?

Open the security or connected apps page of the service that holds your account and remove the app. The token stops working.

Is it safe to click Connect on an AI tool?

It can be, if the scopes are narrow and you trust the publisher. Read the list before you approve, and revoke what you stop using.

How did this land?

About the author

Cecilia Iona
Cecilia Iona

Senior Editor, AI & Product

Cecilia leads the Swarmz editorial desk. She has spent a decade turning complex AI and product topics into writing people actually finish, and she owns the blog's quality bar.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.