Skip to content
What is OpenID Connect?
×

What is OAuth 2.0?

Some apps need your data from another app. OAuth lets them in without ever seeing your password.

Tap the right side to continue →

The old way: hand over your password.

Apps used to ask for your password. Then they could do anything, for as long as they liked. The only way to stop them was to change your password.

OAuth is a valet key.

A valet key starts the car, but won't open the trunk. OAuth gives apps a key like that. It opens only what you allow, and you can cancel it anytime.

Four roles.

You own the data. The app wants to use it. The login server checks who you are and hands out keys. The data server holds your stuff, and checks every key.

You decide on the real site.

The app sends you to the login server. You sign in there, not in the app. Then you see exactly what the app is asking for, and you choose.

Scopes set the limits.

Scopes are the list of permissions an app asks for. The app gets only what you approve. Nothing more.

A code first, then a token.

The login server sends back a one-time code. The app trades it, behind the scenes, for an access token. That keeps the token out of your browser.

The token opens the data.

The app shows its access token to the data server. The server checks it, and hands over only what the token allows.

Tokens expire. Refresh tokens renew them.

Access tokens can expire, which limits the damage if one leaks. A longer-lived refresh token gets a fresh one without asking you again. Store it securely.

Phone and browser apps need PKCE.

These apps can't hide a secret. So the app makes a one-time secret and sends a scrambled version first. To trade the code, it must show the original. A stolen code is useless alone.

Other flows, other jobs.

Machines talking to machines use client credentials. Smart TVs use the device flow, where you finish on your phone. Old shortcuts, the implicit and password grants, are now discouraged.

OAuth is about access, not identity.

OAuth says what an app may do. It doesn't say who you are. To log users in, add OpenID Connect. It sits on top of OAuth and adds an ID token that says who you are.

Quick check

Tap your answer.

With OAuth, does the app see your password?

A phone app uses OAuth. What should it add?

You need to log users in. What do you use?

Let's recap.

A valet key, not a password.

Limited scopes, approved by you, and tokens that expire.

Code flow with PKCE.

Add OpenID Connect when you need to log people in.

Share access. Never share passwords.

Next short →

Sources: Auth0, RFC 9700, OpenID Connect Core.

How do websites remember you?
How should apps store passwords?
What is MFA?
Authn vs. Authz
×