OpenID Connect Definition: How OIDC Works With OAuth 2.0
OpenID Connect (OIDC) gets mentioned constantly in developer docs, security specs, and integration guides, but clear explanations of what it actually does are harder to come by. At its core, the openid connect definition is straightforward: it's a thin identity layer built on top of OAuth 2.0 that lets applications verify who a user is, not just what they're allowed to access. That distinction matters more than most people realize.
OAuth 2.0 handles authorization, granting an app permission to do things on a user's behalf. But it was never designed to answer the question "who just logged in?" OIDC fills that gap by introducing standardized identity tokens and endpoints that make authentication portable and interoperable. For anyone building applications that rely on secure sign-in flows, especially in regulated industries like healthcare, understanding OIDC is foundational, not optional.
This is directly relevant to what we do at SoFaaS. Our platform manages the OAuth and authorization flows required for SMART on FHIR integrations between healthcare apps and EHRs, and OIDC is a core part of that authentication chain. This article breaks down how OpenID Connect works, what makes it different from OAuth 2.0, and why it matters for modern application security, whether you're building in healthcare or anywhere else.
Why OpenID Connect matters
OAuth 2.0 transformed how applications request access to user data without exposing passwords. But OAuth 2.0 was designed for authorization, not authentication. When you use OAuth to grant an app access to your Google Drive files, the app receives a token that says "this user allowed this." It does not get a reliable, standardized answer to the question "who is this user?" That gap is exactly where OpenID Connect steps in.
The authentication gap OAuth 2.0 leaves open
Without a dedicated identity layer, developers building login systems on top of OAuth 2.0 had to invent their own solutions. Each application implemented identity differently, which led to fragmented, inconsistent, and often insecure approaches. Some apps called a custom /me endpoint. Others decoded an access token and assumed the format was stable. None of this was interoperable, meaning a sign-in flow that worked for one service was incompatible with another, and every team was solving the same problem from scratch.
When authentication has no standard, every development team reinvents the wheel, and security suffers each time.
OIDC resolved this by defining a consistent structure: an ID token in JWT format that carries verified claims about who the user is, a UserInfo endpoint for retrieving additional profile data, and standard scopes like openid, email, and profile that tell the authorization server exactly what identity information your application needs.
Why this standardization matters in practice
When you look at the openid connect definition in practical terms, it functions as a contract between your application and the identity provider. Both sides agree on what the ID token looks like, how it's signed, and how it must be validated. This predictability is what makes OIDC reliable at scale, whether you're handling ten users or ten million.
For teams building in regulated industries like healthcare, the stakes go beyond convenience. SMART on FHIR, the standard that governs how third-party apps connect to electronic health records, builds directly on OIDC for its authentication flows. When a clinician launches an app inside an EHR, OIDC is what confirms their identity before any patient data moves. Getting that identity layer wrong is not just a technical failure; it becomes a compliance and patient safety problem.
Regulated or not, any application that handles user accounts benefits from OIDC's standardized, auditable approach to identity. You get a proven protocol backed by the broader industry rather than a custom solution that only your team understands, and your users get a more consistent and secure login experience across every service they touch.
How OIDC works with OAuth 2.0 step by step
Understanding the openid connect definition becomes much clearer when you trace the actual flow. OIDC does not replace OAuth 2.0; it extends it by adding identity-specific components that OAuth was never built to provide. When your application initiates an OIDC flow, it sends users to an authorization server with an openid scope included in the request. That single scope signals that you need authentication, not just authorization.
The authentication request flow
Your application redirects the user to the identity provider's authorization endpoint with specific parameters: the openid scope, a client ID, a redirect URI, and a response type. The user logs in and consents. The authorization server then returns an authorization code to your redirect URI, which your backend exchanges for two tokens: an access token and an ID token.

The ID token is what separates OIDC from plain OAuth 2.0. It's a signed JWT that carries verified claims about the user's identity, not just a permission grant.
The ID token contains structured claims such as sub (the unique user identifier), iss (the issuer), aud (your app's client ID), and exp (expiration time). Your application validates the token's signature against the identity provider's published public keys before trusting any of those claims.
What happens after the ID token arrives
Once your application validates the ID token, you know exactly who logged in. You can use the access token separately to call the UserInfo endpoint and retrieve additional profile attributes like name or email. These two operations are distinct by design: the ID token handles identity, and the access token handles resource access. Keeping them separate is what makes the protocol both secure and flexible for real-world applications.
Key OIDC concepts you need to understand
Several specific components make the openid connect definition concrete and operational. Understanding these building blocks lets you reason about what's happening at each step of an authentication flow, and it helps you debug problems when they come up in real integrations.
The ID token and its claims
The ID token is the centerpiece of OIDC. It's a JSON Web Token (JWT) that your application receives after the user authenticates, and it carries signed, verifiable claims about who that user is. Standard claims include sub for the user's unique identifier, iss for the issuing authority, aud to confirm the token was issued for your specific app, and exp to enforce expiration. Your application must validate the token's signature using the identity provider's public keys before trusting any claim inside it.

Skipping ID token validation because it "looks correct" is one of the most common and consequential mistakes teams make when implementing OIDC.
Scopes and the UserInfo endpoint
Scopes tell the authorization server what identity data your application needs. Including openid in your request is required for any OIDC flow. Adding profile or email signals that you want those specific attributes returned. The UserInfo endpoint is a protected resource your application calls with a valid access token to retrieve those additional attributes after authentication completes.
These two mechanisms work together by design. Your application gets the core identity claims in the ID token immediately, and it fetches supplemental profile data from the UserInfo endpoint only when needed. Keeping these separate gives you control over what your app requests and when, which reduces unnecessary data exposure in every authentication transaction.
OIDC flows and how to choose the right one
The openid connect definition includes several distinct flows, and picking the wrong one creates real security exposure. Each flow determines how tokens are returned to your application and whether your backend server participates in that exchange. Your choice depends on your application's architecture, where code runs, and how sensitive the user data involved is.
Authorization Code Flow
The Authorization Code Flow is the recommended choice for most applications, particularly those with a server-side backend. The authorization server returns a short-lived code to your redirect URI, and your backend exchanges that code for tokens directly with the authorization server. Tokens never travel through the browser, which dramatically reduces interception risk.
If your application has any server-side component capable of storing client secrets, use the Authorization Code Flow with PKCE.
PKCE (Proof Key for Code Exchange) extends the Authorization Code Flow for public clients like mobile apps and single-page applications that cannot securely store a client secret. Your app generates a code verifier and challenge pair at the start of the request, which the authorization server validates before releasing tokens.
Implicit and Hybrid Flows
The Implicit Flow returns tokens directly to the browser without a backend code exchange step. This was designed for JavaScript apps before PKCE existed, but current security guidance from the OAuth working group discourages its use because tokens exposed in the browser URL fragment are harder to protect.
Combining elements of both approaches, the Hybrid Flow returns some tokens from the authorization endpoint and others from the token endpoint. It suits complex enterprise scenarios where different parts of your system need different tokens at different times, but adds implementation complexity that most teams should avoid unless the use case explicitly requires it.
OIDC security and SMART on FHIR notes
Security is where the openid connect definition moves from theory into consequence. OIDC is a well-designed protocol, but implementation mistakes at the security layer are common and costly. Understanding the specific risks helps you avoid the errors that make a technically correct integration dangerously insecure in practice.
Token validation and common security mistakes
Your application must validate the ID token's signature against the identity provider's published JWKS (JSON Web Key Set) endpoint before trusting any claim inside it. Skipping or shortcuts on this step means an attacker could forge an ID token and your application would accept it. You also need to check the iss claim matches your expected issuer, the aud claim matches your client ID, and the exp claim confirms the token has not expired.
Accepting an ID token without full signature and claims validation defeats the entire security model OIDC was built to provide.
Beyond token validation, state parameter handling is critical for preventing cross-site request forgery (CSRF) attacks during the authorization redirect. Your application should generate a random, unpredictable state value on each request and verify it matches when the authorization server redirects back.
How SMART on FHIR uses OIDC
SMART on FHIR extends OIDC with healthcare-specific scopes and context parameters that standard OIDC does not include. When a clinician launches an app inside an EHR, SMART on FHIR uses OIDC to confirm that clinician's identity before any patient records are accessible. The fhirUser claim identifies the authenticated user's FHIR resource, linking their digital identity to their clinical role in the record system.
Managing these healthcare-specific flows correctly requires handling EHR-specific authorization server configurations across systems like Epic and Cerner, which is exactly the complexity that SoFaaS handles for your integration automatically.

Key takeaways
The openid connect definition comes down to one core idea: OIDC adds a standardized identity layer on top of OAuth 2.0 so your application can verify who a user is, not just what they're allowed to do. OAuth handles authorization. OIDC handles authentication. Both work together, and neither fully replaces the other.
For your implementation, the details matter. ID token validation is not optional, the Authorization Code Flow with PKCE is the right default for most architectures, and the state parameter protects your users from CSRF attacks during the redirect cycle. Skip any of these and you introduce real risk, regardless of how well the rest of your integration is built.
In healthcare specifically, SMART on FHIR builds directly on OIDC to control clinician and patient identity before any EHR data moves. If managing those flows sounds complex, launch your SMART on FHIR app with SoFaaS and let the platform handle the hard parts for you.
The Future of Patient Logistics
Exploring the future of all things related to patient logistics, technology and how AI is going to re-shape the way we deliver care.