Cyberstudy
4.6 In progress

Open Authorization (OAuth)

16 flashcards

Summary

OAuth 2.0 is an authorization framework that lets a user grant an application limited access to their resources on another service without sharing their password. It issues access tokens, often in JSON Web Token format. OAuth on its own does not authenticate the user; OpenID Connect adds that.

In plain words

OAuth lets you allow one app to use part of your account on another service without giving it your password. The app gets an access token, often a JWT, from an authorization server and presents it to the resource server (API).

Detailed explanation

  • OAuth 2.0: An authorization framework (RFC 6749) for delegated access to APIs.
  • Resource owner: The user who owns the data.
  • Client: The application requesting access, registered with a client ID and, for confidential clients, a client secret.
  • Authorization server: Authenticates the user, obtains consent and issues tokens.
  • Resource server: The API that holds the data and accepts access tokens.
  • Access token: A short-lived credential that grants specific scopes of access.
  • Scope: The specific permissions requested, such as read-only access to a calendar.
  • Grant type: The flow used to obtain a token; the authorization code flow with PKCE is recommended for most apps.
  • OpenID Connect (OIDC): An identity layer on top of OAuth 2.0 that adds an ID token so the client can authenticate the user.
  • JSON Web Token (JWT): A compact token of header, claims and signature, encoded with Base64url. Encoding isn't encryption, so anyone holding a JWT can read its claims.

Important terms

taken from the text above
OAuth 2.0
An authorization framework (RFC 6749) for delegated access to APIs.
Resource owner
The user who owns the data.
Client
The application requesting access, registered with a client ID and, for confidential clients, a client secret.
Authorization server
Authenticates the user, obtains consent and issues tokens.
Resource server
The API that holds the data and accepts access tokens.
Access token
A short-lived credential that grants specific scopes of access.
Grant type
The flow used to obtain a token; the authorization code flow with PKCE is recommended for most apps.
OpenID Connect (OIDC)
An identity layer on top of OAuth 2.0 that adds an ID token so the client can authenticate the user.
JSON Web Token (JWT)
A compact token of header, claims and signature, encoded with Base64url. Encoding isn't encryption, so anyone holding a JWT can read its claims.

Examples & real-world scenarios

  • Letting a calendar app read (not change) your email calendar.
  • An app registered with a client ID (public) and secret (confidential).
  • JWTs carrying claims, signed for integrity.

Scenario

A fitness app asks to 'view your profile and contacts'. The user approves only the profile scope. The app gets a token limited to that, and never sees the user's password.

Common mistakes

  • Calling OAuth an authentication protocol by itself. It's about delegated authorization.
  • Leaking the client secret in mobile app code.

Practical skills

  • Explain the roles in an OAuth flow: resource owner, client, authorization server, resource server.

What I should remember

  • OAuth 2.0: Authorization, not authentication; delegates limited API access.
  • OpenID Connect: Adds authentication to OAuth 2.0.
  • Access token: Grants specific scopes for a short time.
  • JWT: Signed, Base64url-encoded token whose claims are readable.