In this article
The difference in one table
| OAuth 2.0 | OpenID Connect | |
|---|---|---|
| Purpose | Authorization: access to an API or resource on the user's behalf | Authentication: who the user is |
| Standard | RFC 6749 (IETF, 2012) | OpenID Connect Core 1.0 (OpenID Foundation, 2014), built on OAuth 2.0 |
| What the app gets | access_token | id_token (a JWT with identity claims), usually plus an access_token |
| Scopes | Free-form, e.g. read:invoices | openid is required, plus profile, email and others |
| User data | Not standardised | Standard claims in the id_token and /userinfo |
| Configuration | No standard discovery | /.well-known/openid-configuration (discovery) |
Why plain OAuth 2.0 is not meant for login
An OAuth 2.0 access_token is a key the app shows to an API. It does not tell the app which person granted access, and its format is not standardised. An app that "logs in" a user just because it received an access token relies on assumptions the standard does not guarantee.
OpenID Connect adds the missing piece: a signed id_token carrying the issuer (iss), audience (aud), expiry and a user identifier (sub). Your system verifies the signature with the issuer's public keys (JWKS) and knows reliably who logged in.
The Authorization Code flow with OpenID Connect
Redirect
Your portal sends the user to the
authorization_endpointwithresponse_type=codeandscope=openid profile. Use PKCE.Authenticate
The user logs in – with Dorvis, via Smart-ID, eParaksts, a bank or Digimaks.
Exchange the code
Your server exchanges the
codeat thetoken_endpointfor anid_tokenandaccess_token.Validate
Your server checks the
id_tokensignature,iss,audand expiry, then reads the identity claims.
What Dorvis returns
Dorvis is an OpenID Connect provider. Its discovery URL is https://dorvis.eu/oidc/.well-known/openid-configuration, and after login your system receives these identity claims.
{
"sub": "…",
"given_name": "Jānis",
"family_name": "Bērziņš",
"person_code": "010101-12345"
}Where this helps in practice
Most platforms already support OpenID Connect: Keycloak, Auth0, Microsoft Entra, WordPress, Spring Security, ASP.NET Core and the Node.js libraries. Adding Dorvis usually requires only configuration – see the developer guides.