Skip to content

Once You Know This One

Module 6 of 6 in the chapter OAuth: The Base Pattern, chapter 8 of Securing Salesforce: Identity and Access. Each module stands on its own.

The question this module answers: With so many OAuth flows, why do most of them look the same?

Open Salesforce’s list of OAuth flows for the first time, and it’s a lot. Web server, client credentials, JWT bearer, SAML bearer assertion, SAML assertion, device, asset token, refresh token, token exchange, and the two that are retiring. People see that list and think they have a dozen things to learn.

I don’t want you to see it that way. Three quarters of these look almost identical. What changes is what’s passed at the entrance.

You’ve now seen three flows in this chapter, and they’re one request with one card changed:

The flowgrant_typeWhat’s presented at the entrance
Username-password (retiring)passwordA person’s username and password (module 2)
Client credentialsclient_credentialsThe app’s client ID and secret (module 3)
Refresh tokenrefresh_tokenThe re-entry pass (module 5)

Same address, /services/oauth2/token. Same answer, an access token. Same second step, the stall. That flow is simple, and it’s going to be used for a whole bunch of flows, just substituting what’s presented.

Here’s the rest of the family, with what each one presents:

Once you know this one: what each flow presents Two columns: the flow, and what it presents at the entrance. Username-password, retiring February 20, 2027, chapter 8, in amber: a person's username and password, the one OAuth set out to avoid. Client credentials, chapter 8: the app's client ID and secret, with an integration user behind them. Refresh token, chapters 8 and 13: the re-entry pass, from an earlier flow with a person. Taught later, in slate: JWT bearer, chapter 11, a JWT signed with the app's certificate naming the user to act as; SAML bearer assertion, chapter 11, a signed SAML assertion from a trusted identity provider; the device flow, chapter 9, the device code presented again and again until a person approves it on another screen. Footnote: the same two steps every time; the web server flow is the one that isn't, with a person, a browser and a code first, chapter 9. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.58.0", "built": "2026-11-04", "id": "DGM-IAM-OF-06", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} THE FLOW WHAT IT PRESENTS AT THE ENTRANCE Username-password retiring 2027-02-20 · ch 8 A person's username and password the one OAuth set out to avoid Client credentials ch 8 The app's client ID and secret and an integration user behind them Refresh token ch 8, 13 The re-entry pass from an earlier flow with a person JWT bearer ch 11 A JWT signed with the app's certificate naming the user to act as SAML bearer assertion ch 11 A signed SAML assertion from a trusted identity provider Device flow ch 9 The device code, again and again until a person approves it on another screen The same two steps every time. The web server flow is the one that isn't: a person, a browser and a code first. That's chapter 9. HOW TO READ IT taught in this chapter taught in a later chapter retiring © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge
  • JWT bearer presents a small signed token, a JWT, that names the user the app will act as, signed with the app’s certificate. That’s chapter 3’s signature at work. Chapter 11.
  • SAML bearer assertion presents a signed SAML assertion, like chapter 6’s, from an identity provider the app trusts. Chapter 11.
  • The device flow presents a device code, again and again, until a person approves it on another screen; then the answer is the wristband (chapter 5, module 5). Chapter 9.
  • Token exchange presents a token from another identity provider, and swaps it for a Salesforce one. Chapter 11.

Each one is the same two steps. The client walks to the entrance, presents its proof, gets a wristband, and goes to the stall. Once you can read the base pattern, you can read every one of these. What you learn in each chapter is what’s presented, and why that proof can be trusted.

There’s one flow that doesn’t fit the table, and it’s the most important one: the web server flow.

It isn’t a single step. Before the client ever walks to the entrance, a person has to sign in, in a browser, and say yes. That brings the browser back, with redirects, like single sign-on, and a short-lived code that the app then swaps for its tokens. It’s the most complicated flow, and the one Salesforce recommends whenever a person is using an app (module 2). It’s also where PKCE comes in.

That’s the flip. We built up the simple shape first; chapter 9 goes to the tougher one, at the Burger House. And here’s the thing: once you get the web server flow, the others really are smaller versions. Its last step, swapping the code for a token, is the base pattern you already know.

At the end of this chapter, you can look at any token request and answer three questions:

  1. Where’s it going? Your My Domain’s /services/oauth2/token.
  2. What’s it presenting? The grant_type, and the proof that goes with it.
  3. Who will the wristband be for, and what will it allow? The user it runs as, and the app’s scopes.

That’s most of what an architect needs to read OAuth on the wire.

Over eight chapters, you’ve seen people sign in to Salesforce directly (the Front Door), through an identity provider (chapters 4 and 6), and with Salesforce vouching for them (chapter 7). This chapter added the programs: a client at the entrance, with something to present.

Next comes the flip. Chapter 9 puts a person back in, through an app: the Burger House, the web server flow and PKCE.

  • For each integration, what it presents at the entrance, and whether that proof belongs in that system.
  • Which flows your org allows at all, and which are blocked (the retiring ones first).
  • Who reviews a new app’s flow, before it gets its client ID and secret.