Skip to content
×

What is OpenID Connect?

Signing in to a site with your Google account uses it. It is how the app learns who you are.

Tap the right side to continue →

OAuth gives access, not identity.

OAuth is about sharing access to your data. OpenID Connect is about logging you in. It is an identity layer built on top of OAuth.

One login, many sites.

You click sign in with Google. You go to Google and log in there. Then Google sends you back, and tells the site who you are.

You get an ID token.

The app asks for one extra scope, called openid. Along with the access token, it gets an ID token. Think of a signed visitor badge that says who you are.

What every badge says.

Who issued it. Who you are. Which app it is for. When it was made, and when it expires. Each of these facts is called a claim.

Use sub, not email, to know a user.

Email addresses can change, and they are not guaranteed to be unique. The sub claim is never reused by the issuer. Together, the issuer and sub always point to the same person.

For developers

Check the badge before trusting it.

Check the signature, so you know the issuer made it. Check the issuer and the audience are the ones you expect. Check it has not expired. If any check fails, reject it.

ID tokens are for the app, not APIs.

The ID token tells your app who logged in, for example to greet them by name. To call an API, send the access token. Never use the ID token for that.

Quick check

Tap your answer.

What does OpenID Connect add to OAuth?

Which claim should you use to recognize a user?

Should an app call an API with its ID token?

Let's recap.

Access is not identity.

OAuth gives access. OpenID Connect adds a signed ID token that says who you are.

Check it, then trust it.

Signature, issuer, audience and expiry. Never send it to an API.

Know who your users are, the standard way.

Next short →

Sources: Auth0: OpenID Connect Protocol, OpenID Connect Core 1.0, Auth0: ID Tokens.

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