🧱 Terminologies

Term Description
Client 📦 The application that seeks access to resources. Usually, the third party.
Resource Owner 👤 The user who owns the resources. It can also be a machine 🤖 (E.g., Enterprise scenarios).
Resource 🖼 Could be images, data exposed via APIs, and so on.
Resource Server 📚 Server that hosts protected resources. Usually, an API server that serves resources if a proper token is furnished.
Authorization Server 🛡 Server responsible for authorizing the client and issuing access tokens.
User-Agent 🌐 The browser or mobile application through which the resource owner communicates with our authorization server.
Access Token 🔑 A token which is issued as a result of successful authorization. An access token can be obtained for a set of permissions (scopes) and has a pre-determined lifetime after which it expires.
Refresh Token 🔄 A special type of token that can be used to replenish the access token.

An end-user (resource owner 👤) grants a printing service (app 📦) access to their photo (resource 🖼) hosted in a photo-sharing service (resource server 📚), without sharing their username and password. Instead, they authenticate directly with a server trusted by the photo-sharing service (authorization server 🛡), which issues the printing service delegation-specific credentials (access token 🔑).

Flows in OAuth 2.0

Authorization Code Grant flow

https://res.cloudinary.com/practicaldev/image/fetch/s--AHu-wF84--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2j7kqc7qabtfpl250jf2.gif

Authorization Code Grant with PKCE