OAuth 2.0: Authorization, Not Authentication
OAuth 2.0 is commonly described as an authentication protocol, but that is technically incorrect and the distinction matters. OAuth 2.0 is an authorization framework — it allows an application to obtain limited access to a user's resources without knowing the user's credentials. The user authenticates directly with an authorization server (e.g., Google); the application receives an access token that it can use to call APIs on the user's behalf.
OpenID Connect (OIDC) is the authentication layer built on top of OAuth 2.0. It adds an ID token — a JSON Web Token containing claims about the authenticated user — and a standard way to retrieve user profile information. When you "Sign in with Google," OIDC is the protocol making it work.
The Authorization Code Flow
The most secure and widely recommended flow for web applications:
ID Token Claims
These claims are signed by the authorization server — your application can verify the signature and trust the contents without a round-trip to the server.