OAuth vs OpenID Connect: Why Sign In With Google Needs More Than an Access Token

OAuth 2.0 lets an application request permission to access a resource; OpenID Connect (OIDC) adds a standardized way to sign a person in and establish their identity. They are complementary, not competing login systems. A typical “Sign in with Google” experience uses OIDC to authenticate the user and may also use OAuth 2.0 access tokens if the application needs permission to call an API. The crucial rule: an access token is not proof of who signed in.

OAuth vs OpenID Connect in one table

QuestionOAuth 2.0OpenID Connect
Main purposeDelegated authorization to access a protected resourceAuthentication of the end user, using OAuth 2.0 flows
Typical scenarioLet an app read a user’s calendar with permissionLet a user sign in to an app using an identity provider
Key artifactAccess token for a resource serverID token for the client; access tokens may also be issued
Who consumes it?API/resource server validates the access tokenClient/relying party validates the ID token
Identity proof?Not by itselfYes, when the ID token is correctly validated
StandardsOAuth 2.0 authorization frameworkOpenID Connect specifications built on OAuth 2.0

The OpenID Foundation describes OIDC as an identity layer built on OAuth 2.0. Microsoft’s authentication vs authorization guide makes the same practical distinction.

A real-world example: a calendar app

Imagine you build a study-planner app that wants to show the learner’s calendar events. There are two separate questions:

  1. Who is the learner? If the app supports sign-in through an identity provider, OIDC can provide an ID token that the app validates to establish the user’s identity.
  2. May the app read calendar events? OAuth 2.0 can let the learner authorize scoped API access. The calendar API checks the access token and the permissions granted.

Signing in does not automatically grant access to the calendar. Granting access to a calendar API does not, by itself, mean the app has safely authenticated the person. Keeping these questions separate avoids a common security mistake.

Original flow diagram: where each token belongs

StepActorWhat happensImportant check
1Learner → study appClicks Sign inApp starts a supported OIDC flow
2Study app → identity providerRedirects the user to authenticate and consent where neededState, nonce and PKCE are used as appropriate
3Identity provider → appApp obtains tokens through the supported flowValidate the ID token for sign-in
4App → calendar APIApp presents an access token to request eventsAPI validates the access token, audience, scope and other claims
5Calendar API → appReturns only permitted dataLeast privilege and privacy safeguards apply

Important: This table is a simplified explanatory model. Actual authorization-code flows, token handling, browser sessions and identity-provider behavior vary. Never copy a flow diagram into production without following the provider’s current implementation documentation.

ID token vs access token vs refresh token

TokenPurposeDo not use it for
ID tokenTell the client about the authenticated end userCalling a protected API merely because it contains identity claims
Access tokenAuthorize requests to the intended API/resourceProving a user is logged in to your app
Refresh tokenObtain new tokens under provider policyPublic exposure or casual browser storage

Tokens can be opaque or structured differently depending on the system. A JWT-shaped string is not automatically trustworthy. For ID tokens, validate issuer, audience, expiration, signature and any other claims required by the provider and flow. For access tokens, validation belongs to the intended resource server according to its contract.

How does “Sign in with Google” actually work?

A website that offers Google sign-in typically redirects the browser to Google’s identity service and uses a supported OIDC flow. The site receives a result it must validate before creating its own application session. If it also needs to call a Google API, it requests the necessary permissions and handles the access token separately. Google sign-in should not be implemented by taking an arbitrary API access token and treating it as a user identity.

Five common beginner mistakes

  1. Using OAuth alone as login proof: An API token intended for a resource is not necessarily an authentication assertion for the client.
  2. Confusing the token audience: A token for API A must not be accepted by API B or by a different client merely because it looks valid.
  3. Skipping token validation: Reading a JWT payload is not the same as verifying its signature, issuer, audience and expiry.
  4. Requesting excessive scopes: An app that only needs a calendar read operation should not request unrelated broad permissions.
  5. Writing a custom login flow from scratch: Use current provider SDKs and authorization-code with PKCE where appropriate; avoid deprecated or insecure flows.

Hands-on exercise: classify six requests without writing code

Write Authentication, Authorization, or Both beside each situation before checking the answers.

SituationExpected answerReason
Confirm which person signed in to a study appAuthenticationOIDC establishes identity
Read that person’s calendar with consentAuthorizationOAuth grants scoped API access
Sign in, then fetch a calendar eventBothIdentity and API permission are separate
Validate an ID token’s audience and signatureAuthenticationConfirms the token is meant for this client
API checks whether an access token has read scopeAuthorizationEnforces permission at the resource
Show a user’s name from an unverified JWT stringNeither safelyUnvalidated data is not reliable identity proof

This original exercise is designed to reveal conceptual misunderstandings. For a production system, follow the identity provider’s official developer tutorials and security testing guidance.

Which should you learn first?

If you’re a beginner, learn authentication vs authorization first, then OAuth permissions and scopes, then OIDC and ID-token validation. After that study sessions, cookies, CSRF, PKCE and API authorization. This sequence helps you understand why one protocol alone cannot answer every login-and-access question.

Start with Course Centrals’ Authentication vs Authorization explainer. For related security foundations, read Hashing vs Encryption and the Google Cybersecurity Certificate guide.


Frequently asked questions

Is OpenID Connect a replacement for OAuth 2.0?

No. OIDC builds on OAuth 2.0 to add standardized authentication and identity information.

Can OAuth 2.0 authenticate users?

OAuth 2.0 is an authorization framework. It is not a complete interoperable authentication protocol by itself; use OIDC or another suitable authentication protocol when your app needs user identity.

Is an ID token the same as a JWT?

OIDC ID tokens are JWTs, but not every JWT is an ID token. A JWT’s structure alone does not establish its purpose or validity.

Why do apps need an access token after sign-in?

Sign-in identifies the user; access tokens authorize requests to protected resources when the app needs to call APIs.

Does OpenID Connect require sharing a password with the app?

No. With a properly designed OIDC sign-in, the identity provider handles authentication, and the client receives a validated identity assertion rather than the user’s password.

Is OAuth 2.0 the same as single sign-on?

No. OIDC can enable federated sign-in and SSO using OAuth-based flows; OAuth authorization alone is not the same as a complete SSO system.

Official sources and further learning

Follow Coursecentrals.com on Google
Get more Coursecentrals.com guides, scholarships and learning resources in your Google results.