Which provider facts to trust
Every validated 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. brings claims beyond the issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. and subject. A claim mapping, written down for each provider, gives each claim one job, keeps every claim away from authority the provider can't vouch for, and says when it runs, so a change to it is handled like any security setting.
A mapping gives each claim a job
All people, domains, identifiers and tokens in these examples are fictional.
The ID 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. from Ava's first mail sign-in in Adding social sign-in carried ten claims. The collage app used two of them, the issuer and the subject, to find account 8812. The rest arrived too, signed with the mail service's key, and they arrive with every sign-in through every button. A button that creates accounts has to do something with them: put a name on the new account, offer an address for order confirmations, perhaps unlock free shipping. Deciding which claim fills which field, and what each field is then allowed to decide, is configuration the collage app's team writes down for each provider.
Validation answers one question: did this provider make these statements, for the collage app, just now? It doesn't say what the app may use each statement for. Standard and custom claims and Claim stability and privacy covered what the claims mean: a name is whatever the account holder typed into their profile, and email_verified describes one check the provider made at some time. The collage app turns that understanding into a claim mapping in each provider's configuration entry. Here is the photo button's, which creates accounts:
| Provider claim | Collage app field | What it may decide |
|---|---|---|
iss and sub | Sign-in identity row | Which collage app account opens |
email, when email_verified is true | Offered contact email | Where confirmations go, once the app has confirmed the address itself |
given_name | First name, at registration | How the app greets the customer |
family_name | Last name, at registration | How orders and parcels are addressed |
https://photos.example/claims/membership | Not stored | Free shipping on this visit's orders |
| Any other claim | Not stored | Nothing |
Each row pairs a claim with a decision of a certain weight. Greeting Ava needs any name at all. Sending an order confirmation needs an address someone has checked, and the app checks it again itself before relying on it. Free shipping rests on the photo service's membership claim, because the photo service is the authority on its own memberships. The last row matters as much as the others: a claim the mapping does not name is not stored and decides nothing, so a provider that starts sending something new changes nothing at the collage app until someone agrees what it means and adds a row.
Each provider entry has its own mapping. The mail button's has no membership row, because the mail service knows nothing about photo plans, and if the mail service sent a claim called membership, it would mean something else. Changing one entry's mapping never changes how the other provider's claims are read.
When a mapping runs
The mapping table says when each row applies, and that timing decides how current a stored value can be. The names are copied once, at registration. The membership is read from each visit's ID token and never stored. Neither is wrong, but they behave differently over time.
A value copied at registration is a snapshot. If Ava changes her name at the photo service next year, the app keeps the old one until she edits it, or until the app decides to refresh its copies when updated_at moves forward, as Claim stability and privacy described. A value read at each sign-in is only as current as that sign-in. If Ava's plan lapses on Thursday and she signed in on Monday, Monday's token still says plus and its signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message. still verifies. So the mapping row for free shipping names the freshness it needs: this visit's sign-in, or a fresh check with the photo service at checkout.
Missing claims need a decision of their own, and the mapping records it. A token with no membership claim means the app doesn't know, and checkout charges for shipping rather than assuming the best. A token with no given_name leaves the first name empty on the registration page for the person to fill in, rather than borrowing another claim to fill the gap.
Changing a mapping
Because a mapping is configuration, administrators change it, and a change takes effect at the next sign-in that runs it. On 30 September at 16:55 UTC, an administrator editing the photo entry changes First name from given_name to family_name. Twenty minutes later, a new customer registers through the photo button, and her validated ID token says:
{
"iss": "https://auth.photos.example",
"sub": "user-5310",
"aud": "photo-collage",
"iat": 1790788500,
"exp": 1790788800,
"auth_time": 1790788488,
"nonce": "demo-nonce-37",
"given_name": "Yara",
"family_name": "Haddad",
"email": "[email protected]",
"email_verified": true
}The registration page offers First name Haddad and Last name Haddad. She accepts without looking closely, and the collage app creates account 9137. Every claim was valid and signed, and the app still recorded the wrong thing, because the mistake was in the job the app gave a claim, not in the claim.
The next morning, the administrator sets First name back to given_name, and the next new customer gets the right names. Account 9137 still says Haddad Haddad. The names were copied once, at registration, so a repaired mapping helps only accounts created after it. Fixing account 9137 is a separate step: Yara edits her name, or the app offers the photo service's current names at her next sign-in.
That next sign-in opens account 9137 as before, because the issuer and subject find it, not her name. Neither the mistake nor the repair changed what the account may do. It had no staff role before, during or after, because the mapping has no row that could give it one.
A mapping change deserves the care of any security setting. The collage app records every change with who made it and when, and labels each stored copy with the claim and the time it came from. When Yara's name looked wrong, those records kept apart the steps that could each have failed. The signature had validated, the account had been created rather than linked, and authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. had given it nothing, so the only step left to blame was the mapping, and its history showed who had edited it, twenty minutes before her sign-in. A test sign-in with a known account straight after the edit would have caught the mistake before any customer saw it.
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
- Map provider claims to the right fields and keep them away from authorityPut a verified provider claim in the wrong local field, see what it does and does not change, repair the mapping, and confirm the imported account still has no management authority.