Binding the authentication to the request
A CIBAClient-Initiated Backchannel Authentication: an OpenID Connect flow in which a client asks the provider to authenticate a person on a separate device, such as their phone, with no browser redirect. The client then collects the result by polling, a ping or a push. request can be started by anyone who knows the right hint, and it arrives on the person's phone looking entirely genuine. This lesson follows a stranger who types Ava's email address into a kiosk across town, and the three tools that help: a binding message she compares, a user code that stops the request before it reaches her, and hints that are harder to borrow.
A request you did not make
The poster kiosk asked for one thing before it contacted the photo service: Ava's email address. Anyone can type that. It is on her business card and in every message she has sent. All domains, identifiers and codes in these examples are fictional.
Suppose someone at a kiosk in another shop, across town, types [email protected]. The kiosk is genuine, and so is the photo service, so Ava's phone shows a genuine notification: Poster kiosk wants to sign you in and view your photos. If she approves it, the person at that kiosk sees her albums.
Device authorization had a similar risk, with one important difference. There, an attacker had to persuade Ava to open the verification page and enter their code, usually through a message that might look suspicious. In CIBA, the provider delivers the request itself, in its own app, looking exactly like the requests she approves. The only thing standing between a stranger and her photos is her decision on that screen.
Codes, links, and approval prompts described what happens when people receive prompts they did not expect. Some approve one out of habit, and a stream of them can wear a person down until they approve just to make them stop. A request that anyone can send by knowing an email address invites exactly that. Even if Ava declines every one, the prompts are a nuisance, and someone could send them simply to harass her.
One protection is already built in. Every backchannel request is authenticated, so the photo service knows which client sent it. It can limit how many requests a client sends for one account and cut off a client that misbehaves. That limits the damage, but it cannot tell Ava's request from a stranger's when both come from the same kind of kiosk.
CIBA and its higher-security profiles add three further tools, which act at different points. A binding message helps Ava recognize her own request. A user code stops unwanted requests before they reach her. And a better hint makes her harder to name in the first place.
Matching the binding message
The kiosk in front of Ava sent binding_message=H4PX with its request and showed the same code on its screen. The photo service shows it on her phone as part of the approval: Approve only if the kiosk shows H4PX. The message binds the two devices together for this one transaction. Ava compares what is in front of her with what is in her hand, and approves only if they match.
If the stranger across town started a request for her at the same moment, her phone would show two requests with two different codes, and only one would match the kiosk in front of her. If she is not at a kiosk at all, there is nothing to compare with, and that is the moment to decline, just as with a device code that arrives in an email.
Started by Ava
- Hint typed
- [email protected]
- Kiosk screen shows
- H4PX
- Ava's phone shows
- H4PX
- Matches the screen
- Yes
Ava approves. The kiosk shows her albums.
Started by a stranger
- Hint typed
- [email protected]
- Kiosk screen shows
- K7RM
- Ava's phone shows
- K7RM
- Matches the screen
- No kiosk in front of her shows it
Ava declines. The stranger receives access_denied.
A binding message helps only if Ava actually compares it.
The specification asks for a value that lets the person reliably tell that the two screens belong to the same transaction, such as a random code, and for it to be short and written in plain characters, since it has to fit small displays and be read by a person. A provider that finds a message unsuitable answers invalid_binding_message.
A binding message depends on Ava. It helps only if she actually compares it, and a tired glance at four characters is not much of a check. It is also chosen by the client, so it protects her from strangers using honest kiosks, not from a dishonest client that copies a code from a screen it can see. Where that risk matters, the FAPIOpenID Foundation security profiles that fix how OAuth and OpenID Connect are combined for high-risk APIs, such as open banking. FAPI 2.0 requires choices such as PAR, PKCE and sender-constrained tokens, and conformance tests check that a deployment follows them. profile for CIBA suggests carrying the code to the phone in a way that does not rely on the eye, such as scanning it as a QR code, or identifying the person with a value that starts on their own phone, as the last section describes.
A code only you know
A binding message helps Ava choose correctly among requests that have already reached her phone. A user code stops a request before it gets there. It is a secret she sets up with the photo service in advance, such as a short PIN, and it is not her password. When the photo service supports user codes and her account has one, the kiosk must ask her for it and send it with the request:
POST /bc-authorize HTTP/1.1
Host: auth.photos.example
Content-Type: application/x-www-form-urlencoded
scope=openid%20photos.read
&login_hint=ava%40mail.example
&user_code=7193
&binding_message=H4PX
&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer
&client_assertion=eyJhbGciOiJFUzI1NiIsImtpZCI6Imtpb3NrLTIwMjYtMTAiLCJ0eXAiOiJKV1QifQ...The assertion is shortened here for display. The photo service checks the code before it sends anything to Ava's phone. A stranger who knows her email address but not her code receives invalid_user_code, and her phone stays quiet. A request that leaves the code out for an account that needs one receives missing_user_code, which also tells the kiosk to ask for the code and try again. A four-digit code could be guessed, so the photo service should limit failed attempts for each account, as it would for any short code.
The photo service advertises support in its discovery metadata as backchannel_user_code_parameter_supported, and a client records in its registration, as backchannel_user_code_parameter, that it can send one. The kiosk must never store the code. It asks for it each time. Setting up and changing the code happen at the photo service, for example in its app, and are outside CIBA itself.
Not every client needs one. The specification suggests that a client that has already established a relationship with the person before sending a request can go without, such as a website using CIBA to ask for stronger authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do. after they signed in, or a call center that identified them by the number they called from. So can a client that does not use a fixed identifier, such as an email address, as its hint. A kiosk where anyone can type any address is the case user codes were made for.
Choosing a better hint
The root of the problem is the hint. An email address is a fixed, widely known identifier that works from any kiosk. It also has privacy costs: the kiosk learns it, and someone standing behind Ava can read it. The privacy section of the CIBA specification and the FAPI profile both point toward hints that are harder to borrow.
One option starts on Ava's phone, where the photo service already knows her. The specification describes a design in which the photo service's app shows a QR code made for this one sign-in, and she scans it at the kiosk. The kiosk passes what it read to the photo service in a login_hint_token. Only someone holding her unlocked phone could produce that code, and it works once. The format of a login_hint_token is left to the deployment. The specification recommends that whoever issues one signs it, so the provider can tell it is genuine and unaltered, and a provider that receives an expired one answers expired_login_hint_token.
A client that has signed Ava in before can send that earlier ID tokenIn OpenID Connect, a signed JWT from the provider, addressed to one client, saying which account authenticated, when, and in answer to which request. It reports a sign-in and is not used to call APIs. as an id_token_hint. With a pairwise subject identifierA subject identifier that an OpenID Provider calculates separately for each relying party, or each group of relying parties sharing a sector, so that two unrelated services cannot match up the same person by comparing sub values. and no profile claims, it names her without revealing anything like an email address. The photo service accepts it only if it issued the tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. itself and the presenting client is in its audience. It may accept a token that has expired, since the hint identifies her rather than proving a recent sign-in. The kiosk would still need a way to find her earlier token, such as a loyalty card, and that brings trade-offs of its own.
Hints remain hints. Whichever one the kiosk uses, the photo service still authenticates Ava on her phone, and the decision is still hers. When she declines a request she did not start, the stranger's kiosk receives access_denied the next time it asks the token endpointThe authorization server address where clients exchange an authorization code, refresh token, or other grant for tokens, in a direct request rather than through a browser redirect., and nothing more. If the request turns out to have been hers after all, she can simply start again at the kiosk.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Bind a backchannel request to the person in front of the screenCompare binding messages when two kiosks ask for Ava at once, make the tenant require one, see the per-person request limit, and name Ava with an ID token instead of her email address.