Skip to content
uencoder

OAuth

OAuth 2.0 is an authorization framework that lets third-party applications access a user's resources with the user's consent, without sharing passwords, by using tokens.

Purpose

It implements delegated authorization: an application can access the user's resources on another service without ever seeing the password.

Mechanism

Flow: the client requests authorization from the authorization server → the user grants it → the client receives an authorization code → exchanges it for an access_token → uses the token against the resource server. Grant types: authorization_code, implicit, password, client_credentials, and refresh_token.

Use cases

  • Third-party login (Sign in with Google)
  • Authorized API access
  • Cross-service SSO
  • Mobile authorization

Examples

  • Input
    authorization code → access_token
    Output
    Call the API with the token

    The authorization code flow

Common errors

The implicit flow exposes the token to the browser
Use authorization_code with PKCE

Related terms

Related tools

References