Three players, one handshake, and a secret that never touches the browser.
What the person actually sees and clicks. Anything shown here is public.
Runs on a server the public can't inspect. This is where the real secret lives.
Decides whether to trust the Rails app, and hands out the real access token.
Rides through the browser in a URL. Short-lived, and by itself useless — nobody can act on it.
Only ever handed to Rails, directly, alongside a client secret only Rails knows. This is the real credential.