Skip to content
IT glossary
SecurityUpdated December 3, 2026

OAuth 2.0

OAuth 2.0 lets an app get limited access to another service without asking for your password. The app uses an access token to make the API requests it has permission to make.

Also known as: OAuth

What problem does OAuth 2.0 solve?

Say you want a printing app to import photos from your cloud library. The app needs to read your photos, but it doesn't need your password or permission to delete anything. OAuth 2.0 gives the photo service a standard way to grant that limited access. This is called delegated authorization.

In OAuth terminology, the printing app is the client, you're the resource owner, and the photo API is the resource server. The authorization server issues tokens. The same company can run both servers, but their jobs are different: one grants access and the other enforces it. The client can request a set of permissions, called scopes, such as photos.read.

Follow the authorization code

A common choice for web and mobile apps is Authorization Code with PKCE. Here's what happens when you choose to connect your photo library:

  1. The app sends your browser to the authorization server. The request includes the desired scope and a code_challenge derived from a fresh, random code_verifier that the app keeps for the exchange.
  2. The authorization server signs you in or uses your existing session, and asks for consent if needed. It then redirects the browser to the app's registered callback with a short-lived, single-use authorization code, not an access token.
  3. The app sends the code and the original code_verifier directly to the token endpoint over HTTPS. The authorization server checks the verifier against the earlier challenge before issuing tokens. This PKCE check makes the code alone insufficient to redeem it.
  4. The app uses the access token to call the photo API. If it's a bearer token, the request might look like this:
GET /photos HTTP/1.1
Host: photos.example
Authorization: Bearer <access_token>

The API checks that the token is valid and that the granted permissions cover the operation. If a refresh token was issued, the app can send it to the token endpoint to get a new access token. It doesn't send the refresh token to the photo API.

Where the terminology trips people up

OAuth 2.0 isn't itself a sign-in protocol. OpenID Connect (OIDC) builds on it to standardize sign-in: the client validates an ID token to establish who signed in. An access token is for calling an API, not proof of sign-in for the client. It doesn't have to be a JWT, either; it can be an opaque value whose status and permissions the API looks up with the authorization server.

Not every OAuth flow involves a person. With the Client Credentials grant, a backend service can obtain a token to act on its own behalf. That fits a scheduled service-to-service job better than a browser redirect and a consent screen.

What interviewers listen for

When you walk through a flow, say who receives each credential. The authorization code goes to the client through the browser, the verifier goes to the token endpoint during the exchange, and the access token goes to the API. If the task is user sign-in rather than API access, explain what OIDC adds instead of treating the two names as interchangeable.