Borrowing Somebody Elses Proof
Last timeA Short One and a Long One
Signing in with another account means three parties, several redirects, and a short code exchanged for a token. Here is the exchange, with what each step proves and to whom.
The triangle
Everything so far had two parties: a person and a system. Delegated
sign-in has three, and most of the confusion about it comes from trying to
think about three parties with a two-party picture.
The person wants to use a site. The site wants to know who they are. A
third party, the authority, already knows them, because they have an
account there with a password and probably a second factor. The point of
the exercise is for the site to learn who the person is without ever
touching the proof.
Each edge of that triangle carries a different trust relationship. The
person trusts the authority with a password, and has done for years. The
site trusts the authority to make honest statements about people. The
authority trusts neither of the others and asks the person directly, in its
own window, whether this particular site may be told anything.
- time the person waits for the sign-in
- number of redirects in the exchange
- typical round trip latency
The exchange
Follow it once, slowly.
leg one, through the browser
GET /authorize
client_id=site-1182
redirect_uri=https://app.northwind.co/return
response_type=code
scope=openid profile email
state=nTq8vK2wZ4
code_challenge=hash of the secret verifier
code_challenge_method=S256
returns to https://app.northwind.co/return
code=bb41c7d9
state=nTq8vK2wZ4
leg two, site straight to authority
POST /token
grant_type=authorization_code
code=bb41c7d9
client_id=site-1182
client_secret=held only by the site
code_verifier=the secret itself
returns
access_token, refresh_token, id_tokenWhat each step proves
Now the useful exercise. Walk the same flow and ask, at each step, which
party has proved what to which other party. The answers are more lopsided
than people expect.
The lesson stops here
3 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents