OpenID Connect and OAuth: The Basics
OAuth is about access. OpenID Connect is about identity. If your question is "who just signed in?", OpenID Connect is the one that answers it.
The names sound alike and the two work together, which is why they get mixed up.
OAuth: what it does
OAuth 2.0 lets a third-party app get limited access to an HTTP service. The RFC says it enables an application to obtain limited access to an HTTP service.1
Here's a quick example. A scheduling app wants to read your calendar. You don't hand it your password. Instead, you approve a narrow kind of access, and the calendar service gives the app a pass for it. That pass is called an access token.
Notice what's missing. Nothing in that story says who you are. The OpenID Connect spec says the OAuth specifications define ways to get and use access tokens, but they don't define standard methods to provide identity information.2
Wikipedia puts it plainly: OAuth is an authorization protocol, rather than an authentication protocol.3
OpenID Connect: what it adds
OpenID Connect, or OIDC, adds the missing piece. The spec calls it a simple identity layer on top of OAuth 2.0. It lets a client verify the identity of the person, based on the authentication done by an authorization server.2
Wikipedia says the same thing another way: OIDC is an authentication layer built on top of OAuth 2.0.3
The proof of sign-in arrives as an ID Token. The spec describes it as a security token that contains claims about the authentication of the person.2 A claim is one fact, such as a name.
Side by side
| Question | OAuth | OpenID Connect |
|---|---|---|
| Main job | Limited access to a service1 | Sign-in and identity2 |
| Kind of protocol | Authorization, not authentication3 | Authentication layer on OAuth 2.03 |
| What you get back | An access token2 | An ID Token with claims2 |
Which one handles sign-in?
OpenID Connect. Using OAuth alone for sign-in is called pseudo-authentication, as the Wikipedia page on OAuth explains.3
An app's SSO settings may offer SAML, OpenID Connect, or both. Check the app's own set-up page to see which. The SAML page covers the other choice.
Consent screens
OIDC set-ups can ask you to make choices. Wikipedia says OpenID Connect and similar schemes may require users to make choices during a sign-on to a resource. Those choices, such as user consent, can be turned off so the scheme works as single sign-on.4
So an extra consent step doesn't always happen. Whether it does in your set-up is a question for your admin console and the app's help pages.
What to remember when you pick or set up an app
- "OAuth" on its own is about access to data.
- "OpenID Connect" or "OIDC" is the sign-in layer.
- The ID Token carries the facts about who signed in.
If an app says it supports "OAuth login," ask whether it means OpenID Connect. The two aren't interchangeable.
Cited material
- The OAuth 2.0 Authorization Framework (RFC 6749), Internet Engineering Task Force
- OpenID Connect Core 1.0, OpenID Foundation
- OAuth, Wikipedia
- Single sign-on, Wikipedia