Learning Record learning from practice

· security / authentication

Sign in with Google, Microsoft, or GitHub: OAuth 2.0 or OpenID Connect?

Every “Sign in with …” button starts with a redirect to the provider, so it is tempting to call all of them “OAuth”. Not quite. Google and Microsoft sign-in use OpenID Connect (OIDC), an identity layer on top of OAuth 2.0. GitHub’s user sign-in for OAuth apps is plain OAuth 2.0.

OAuth 2.0 vs. OpenID Connect

  OAuth 2.0 OpenID Connect
Problem it solves Authorization: let an app call an API on the user’s behalf Authentication: tell the app who the user is
What the client gets access_token for an API Also an id_token, a signed JWT with iss, sub, aud, exp, iat
How a request opts in — openid in scope
Provider metadata — /.well-known/openid-configuration discovery document

RFC 6749 states that authenticating resource owners to clients is out of scope for OAuth 2.0. OIDC Core says the same thing from the other side: OAuth 2.0 alone does not define standard methods to provide identity information.

So an app that signs users in with plain OAuth 2.0 must take a detour: get an access token, then call a provider-specific user API. For GitHub, that API is GET https://api.github.com/user.

Provider by provider

Provider User sign-in protocol Evidence
Google OIDC (OpenID Certified) Discovery at https://accounts.google.com/.well-known/openid-configuration; the code exchange returns an id_token
Microsoft Entra ID (login.microsoftonline.com) OAuth 2.0 + OIDC; SAML 2.0 for SAML apps Microsoft documents “standards-compliant implementations of OAuth 2.0 and OpenID Connect (OIDC) 1.0”, plus a separate SAML 2.0 SSO protocol
GitHub (OAuth apps) OAuth 2.0 The token response contains access_token, scope, token_type (and refresh_token for expiring tokens), but no id_token. Docs say to call /user to identify the user

GitHub does run an OIDC provider, but for GitHub Actions, not for user sign-in. Its issuer is https://token.actions.githubusercontent.com. Each workflow job gets a JWT that a cloud provider such as Azure or AWS can exchange for a short-lived credential, so no long-lived cloud secret has to be stored in GitHub.

Is Azure’s authentication OAuth, or just “compatible”?

It is standard OAuth 2.0 and OIDC 1.0, not a proprietary look-alike. Everyday Azure sign-in scenarios map onto standard grants:

Scenario Flow
Browser sign-in to a web app or SPA Authorization code (+ PKCE), with OIDC for the id_token
az login on Linux/macOS, or Windows with the broker disabled Authorization code in a browser; device code if no browser can be opened
az login --use-device-code Device code
Daemon or service principal calling Graph or ARM Client credentials (secret or certificate)
Web API calling a downstream API as the user On-behalf-of
Workload on an Azure resource Managed identity: the platform obtains Entra tokens, and the code never handles a credential

On Windows, az login defaults to the Web Account Manager (WAM) broker since Azure CLI 2.61.0.

Each access token’s aud claim names the resource it is for, for example Microsoft Graph. Clients should still treat access tokens as opaque. Microsoft notes that tokens for its own APIs, such as Graph, use a proprietary format and may not be decodable JWTs.

Check it yourself

Invoke-RestMethod https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration | Select-Object issuer, authorization_endpoint, token_endpoint
Invoke-RestMethod https://accounts.google.com/.well-known/openid-configuration | Select-Object issuer, scopes_supported
Invoke-RestMethod https://token.actions.githubusercontent.com/.well-known/openid-configuration | Select-Object issuer, jwks_uri

A provider that supports OIDC Discovery serves a JSON document at its issuer URL plus /.well-known/openid-configuration. Its issuer value must match the iss claim in the ID tokens it issues. Microsoft’s multi-tenant common endpoint returns the template https://login.microsoftonline.com/{tenantid}/v2.0, which is filled in with each token’s tenant.

References