Order the OAuth Code Flow steps so the token arrives without an intruder intercepting it: 14 levels of OAuth 2.0, PKCE and token exchange.
Lumbung Road has three places. A villager's house is the app. The village office is the provider that knows who you are (OAuth calls it the authorization server). The rice barn keeps the rice and serves only passes from the village office (the resource server). Every message the app sends is run on foot like a relay baton. What it carries is written on the baton: the real parameters sent over the network, recorded from a real OpenID provider and a real client. Lay out the steps, then run them: the baton falls at the step that does not have what it needs yet.
code, and the house exchanges it for a pass. Lay out the relay until the rice barn answers.jatah-beras-lama) uses implicit: with no exchange step, the village office sends the pass straight home in the address fragment (#access_token=…). Lay out the relay, then see what a village office that follows RFC 9700 answers.jatah-beras-hp cannot keep a secret, so it uses PKCE: a random code_verifier, the code_challenge when asking permission, then the verifier when exchanging the code. The challenge is really computed on this page.client_id and its secret (client credentials), then reads /stok.refresh_token. Lay out the relay: the barn refuses the old pass, the house refreshes it at the village office without Mr. Harun signing in again, then tries again.user_code, and Grandma Marni approves it at the village office while the TV keeps asking. Lay out the relay until the TV holds a pass.scope=openid, so the village office also gives an id_token: a letter saying who signed in. Before the house trusts that letter, and before it uses the pass from the same answer, the house checks it. The checks really run on this page.kartu-beras app at Mr. Piksel's internet cafe uses a pass that is a random number, not a JWT: the rice barn cannot read it by itself. Lay out the relay: the rice barn asks the village office whether that pass is still active before it answers.kartu-beras app, and the house hands her refresh_token back to the village office (revocation). After that an old window at the house still tries the rice barn with the old pass. Lay out the relay until the rice barn refuses.state, sends it to the village office, and before exchanging the code checks that the state coming home is the one it sent. Lay out the relay.refresh_token and marks the old one as used (rotation). Lay out two refreshes in a row, then ask for the ration with the newest pass.And more, 14 levels in all.