OAuth 2.0 vs OIDC: What Each Does and When to Use It
OAuth 2.0 vs OIDC: What Each Does and When to Use It

OAuth 2.0 decides what an application may access. OpenID Connect (OIDC) tells that application who the user is. OIDC is not a competitor to OAuth 2.0: it is a thin identity layer built on top of it. Okta’s developer documentation frames it the same way: OAuth 2.0 answers “what can the application access?” and OIDC answers “who is the user?”
That sounds simple, and it still causes a surprising number of broken logins and security gaps. This guide explains the difference in plain terms, shows how the flows work, covers where SAML fits, and lists the mistakes we see when teams wire identity into real products.
TL;DR
- OAuth 2.0 is an authorization framework. It issues access tokens so an app or service can call an API on someone’s behalf, or on its own behalf.
- OIDC is an authentication layer on top of OAuth 2.0. It adds an ID token (a JWT) and standard user claims so an app can sign a person in.
- You cannot use OIDC without OAuth 2.0, but you can use OAuth 2.0 without OIDC, for example in machine-to-machine calls with the client credentials grant.
- OIDC does not replace SAML. Many organizations run both: SAML for legacy enterprise SSO, OIDC for modern web, mobile and API-driven apps.
- Skip the legacy flows. Use the authorization code flow with PKCE and avoid the implicit grant in new builds.
Table of Contents
- The core difference: authorization vs. authentication
- How OIDC sits on top of OAuth 2.0
- OAuth 2.0 flows explained
- OpenID Connect explained: what the ID token gives you
- OAuth vs SAML (and where OIDC fits)
- Which one do you need? A quick decision path
- Mistakes that cause real incidents
- Our perspective: identity is where integrations quietly fail
- Getting identity right in a custom build
- FAQ
- Sources
The core difference: authorization vs. authentication
Two words do all the work here.
Authorization is permission. A calendar app asks for permission to read your events. You approve, and the app receives an access token that works for that scope and nothing more. The app never learns your password and, strictly speaking, does not learn who you are. It just holds a key to a specific door.
Authentication is identity. A login screen asks “who is this person?” and the answer must be something the app can trust and verify.
A hotel analogy works well. OAuth 2.0 is the key card: it opens certain rooms. OIDC is the check-in desk: it verifies who you are, then hands you the key. The key card alone says nothing reliable about the person holding it.
This is the root of the most common integration bug. According to the Okta documentation on OAuth and OIDC, developers who treat an OAuth access token as proof of user identity create security gaps. An access token is meant for the API that receives it. It is not a login receipt for your app.

How OIDC sits on top of OAuth 2.0
The OpenID Connect Core 1.0 specification describes OIDC as a simple identity layer on top of OAuth 2.0. It lets a client verify the end user’s identity based on authentication performed by an authorization server, and obtain basic profile information in a standard way.
In practice OIDC adds four things:
- The
openidscope. This is the switch. Include it in your authorization request and the server treats the exchange as OpenID Connect. Leave it out and you get plain OAuth 2.0, with no ID token. Forgetting this scope is a classic cause of “my login works in one system but not the other.” - An ID token. A signed JSON Web Token (JWT) that states who authenticated, when, and for which client.
- Standard claims and scopes. Scopes like
profileandemailreturn user attributes under agreed names, so you are not parsing a different payload for every provider. - A UserInfo endpoint and discovery. Your app can fetch profile data from a known endpoint and read provider settings from a standard metadata document.
Side-by-side comparison
| OAuth 2.0 | OpenID Connect | |
|---|---|---|
| Purpose | Delegated authorization | User authentication (and identity) |
| Question it answers | What can this app access? | Who is this user? |
| Main token | Access token (often opaque or a bearer token) | ID token (always a JWT) plus an access token |
| Needs the other? | Works alone | Requires OAuth 2.0 |
| Typical use | API access, M2M calls, third-party integrations | Sign in with a work or social account, single sign-on |
| Switch to enable | Default behavior | Include the openid scope |
The Okta guide also notes that OAuth 2.0 typically relies on bearer tokens for access, while OIDC introduces the standardized ID token and user profile claims.
OAuth 2.0 flows explained
A “flow” (the spec calls them grant types) is the sequence an app follows to get tokens. You will meet three in practice.
Authorization code flow with PKCE
This is the default for anything with a human user: web apps, single-page apps and mobile apps.
- The app redirects the user to the authorization server. For OIDC, the request includes the
openidscope. - The user signs in and consents.
- The server redirects back with a short-lived authorization code.
- The app exchanges the code, plus a PKCE code verifier, for tokens at the token endpoint.
PKCE (Proof Key for Code Exchange) binds the code to the app instance that asked for it, so a stolen code is useless to an attacker. RFC 9700, the current best practice for OAuth 2.0 security, updates the older threat model with what the industry has learned since OAuth 2.0 was published. For browser-based apps, RFC 10017 (published in August 2026) lays out the architectural patterns and their security trade-offs.
Client credentials grant
When no person is involved, such as a nightly job calling an internal API or one microservice calling another, the client authenticates as itself and receives an access token. Curity’s write-up on OAuth and OIDC names this as the established approach for machine-to-machine scenarios. There is no user, so OIDC has nothing to add. This is the clearest proof that OAuth 2.0 is not obsolete.
Implicit and password grants: leave them behind
The implicit grant returned tokens straight through the browser URL. The resource owner password grant had apps collect a user’s credentials directly. Both are legacy. RFC 9700 tells practitioners to move away from insecure modes like these, and the OAuth 2.1 draft consolidates that guidance into one framework. It is still an Internet-Draft, so treat it as direction rather than a finished standard. If an older codebase still uses these flows, that is technical debt, and in a regulated field like healthcare it can become a compliance problem.
OpenID Connect explained: what the ID token gives you
The ID token is the heart of OIDC. When your app receives one, it should validate it before trusting anything inside:
- the signature, against the provider’s published keys;
- the issuer (
iss) and audience (aud), so the token is from the right provider and meant for your app; - the expiry (
exp) and, if you sent one, thenonce.
Once validated, the sub claim is the stable identifier for that user at that provider. Key your user records on sub, not on an email address, which can change.
Keep the two tokens separate in your head and your code. The ID token is for your app, to establish who signed in. The access token is for the API, to authorize a call. Do not send an ID token to an API as if it were an access token, and do not read an access token in your front end to learn who the user is.
OAuth vs SAML (and where OIDC fits)
More people search for OAuth versus SAML than for OAuth versus OIDC, mostly because SAML is the other name that comes up when a customer asks for single sign-on. The comparison is slightly off, since SAML is an authentication and federation standard, so the true comparison is SAML versus OIDC.
According to Microsoft’s SAML vs. OIDC decision guide:
- SAML 2.0 is an XML-based federation standard widely used for established enterprise SSO.
- OIDC is a JSON- and REST-based protocol that suits web, mobile and cloud-native apps, with a lighter implementation burden than SAML’s XML processing.
- Many enterprise buyers still require SAML, so procurement can decide for you.
| Situation | Usually the better fit |
|---|---|
| New SaaS product with web and mobile clients | OIDC |
| Single-page app or native mobile app | OIDC with authorization code and PKCE |
| Enterprise customer whose IT team mandates SAML | SAML, often alongside OIDC for everyone else |
| Service-to-service API calls | OAuth 2.0 client credentials |
| Third-party app that only needs limited API access to user data | OAuth 2.0 (add OIDC if the app also signs users in) |
The practical answer for most growing software companies is “both.” Microsoft’s guide notes that modern hybrid environments often run the two protocols side by side, using SAML for legacy enterprise SSO and OIDC for API-driven applications. Pick per use case, not per ideology.
If you sell software to larger companies, expect identity questions to show up in security reviews. Our piece on SOC 2 for SaaS covers how to answer those reviews without drowning in 200-question spreadsheets.
Which one do you need? A quick decision path
Work through these in order.
- Is there a human who needs to sign in? If yes, you need OIDC (on top of OAuth 2.0). If no, OAuth 2.0 alone is enough.
- Does your app call APIs on a user’s behalf? Then you also need access tokens and scopes, which means OAuth 2.0 is in play regardless.
- Is a customer demanding SAML? Support SAML for that customer. It does not stop you using OIDC elsewhere.
- Is the client a browser or mobile app? Use the authorization code flow with PKCE. Do not use the implicit grant.
- Do you want to build this yourself? Usually no. Use an established identity provider or a well-maintained authorization server and spend your effort on scopes, token validation and session handling.
Mistakes that cause real incidents
Most failures are not in the protocol. They are in the details around it.
Treating access tokens as identity. Covered above, and the single most common conceptual error.
Forgetting the openid scope. Without it, the server treats your request as plain OAuth 2.0 and returns no ID token. The OpenID Connect Core specification defines this behavior, and the symptom is a login that appears to work but returns no identity data.
Broken PKCE. Adding PKCE is not the same as implementing it correctly. Public vulnerability records show how it goes wrong in practice. CVE-2026-26247 describes a Gitea flaw where the S256 challenge method was not persisted correctly, allowing token exchange without the expected verifier check. CVE-2026-16615 describes a library that generated its PKCE code verifier with an insecure pseudo-random number generator. Default library settings deserve an audit, not blind trust.
Loose redirect URI handling and missing token validation. RFC 9700 is the checklist to review against. Exact redirect URI matching, short token lifetimes and validating every ID token claim are all areas where shortcuts hurt later.
Storing tokens carelessly in the browser. RFC 10017 walks through the patterns for browser-based apps and what each one exposes. Choose one deliberately instead of inheriting whatever a tutorial used.

Our perspective: identity is where integrations quietly fail
We build custom software, workflow automation and system integrations, and identity is rarely the part a client asks about first. It is, however, the part that decides whether an integration survives a security review.
Here is what we have learned to watch for. Teams rarely get the headline definitions wrong. They get the seams wrong: an access token passed where an ID token belongs, a library default nobody reviewed, a legacy flow left in because it still works. These are cheap to fix on day one and expensive after launch.
Our view is that you should decide the identity model during discovery, before a single screen is built. Who signs in? Which systems call which APIs? Does a customer need SAML? Which data is regulated? For healthcare clients, that last question shapes everything, because the tokens, sessions and audit trail all sit inside the compliance boundary. We design with HIPAA in mind from the start, as in our HIPAA-compliant patient portal case study, rather than bolting it on.
We also push back on building authentication from scratch. Use a proven standard and a maintained implementation, then put your engineering budget into the business logic that makes your product different. Our engineers come from big tech backgrounds, and the habit that carries over most is simple: read the current best practice document before you write the integration, not after the pen test.
— Cameron
Getting identity right in a custom build
If you are planning a product or an integration that touches login, single sign-on or third-party APIs, the cheapest moment to settle the identity design is before development starts. Our Discovery Audit is a $999 one-off engagement that maps your systems, data flows and risks, and it is credited toward a build contract if you go ahead with us. For a sense of what a full build costs, see our custom software cost guide, which lists MVPs at $10,000 to $50,000 and mid-complexity platforms at $50,000 to $150,000. If your challenge is connecting existing systems, our system integration work is the place to start.
FAQ
Is OAuth 2.0 obsolete?
No. OAuth 2.0 remains the foundation that OIDC and other extensions are built on, and it is still the right tool for machine-to-machine access with the client credentials grant. What is aging is certain legacy modes, such as the implicit grant, which RFC 9700 steers developers away from. OAuth 2.1 is a draft that gathers those stricter practices in one place.
Can OIDC be used without OAuth?
No. OIDC relies on the OAuth 2.0 protocol flow for its underlying communication, as Curity explains. The OpenID Connect Core specification defines it as an identity layer on top of OAuth 2.0. Without the OAuth 2.0 exchange, there is no OIDC.
Does OAuth use OIDC?
Only when you ask for it. OAuth 2.0 alone does not provide user authentication. When the authorization request includes the openid scope, the server treats it as OpenID Connect and returns an ID token. Plenty of OAuth 2.0 deployments, such as service-to-service API access, never involve OIDC.
Is OIDC a replacement for SAML?
Not exactly. The two serve different contexts, and Microsoft’s decision guide points out that SAML remains a requirement in many enterprise procurement processes. OIDC is usually the default for new web, mobile and cloud-native apps. Many organizations run both.
Should I use the implicit flow for my single-page app?
No. Use the authorization code flow with PKCE. The current security guidance in RFC 9700 and the browser-app guidance in RFC 10017 both point that way, and the OAuth 2.1 draft removes the implicit grant altogether.
Sources
- Okta Developer: OAuth 2.0 and OpenID Connect overview
- Microsoft Learn: SAML vs. OIDC decision guide
- Curity: More to OAuth and OIDC than JWTs
- RFC 9700: Best Current Practice for OAuth 2.0 Security
- RFC 10017: OAuth 2.0 for Browser-Based Applications
- OpenID Connect Core 1.0 incorporating errata set 2
- IETF draft: The OAuth 2.1 Authorization Framework
- NVD: CVE-2026-26247
- NVD: CVE-2026-16615