Adding social sign-in
A row of provider buttons on a sign-in page gives people familiar ways in, and each button is another entrance to the same accounts. The relying partyAn application that accepts and relies on a sign-in from another service, the name used in OpenID Connect and for passkeys. SAML calls the same role a service provider. sets rules for every entrance: who it may let in for the first time, how far it relies on the provider's sign-in, and what happens when the provider changes or goes away.
Another entrance to the same application
All domains, identifiers and tokens in these examples are fictional.
On 29 September, the day after Ava linked her photo account, she goes back to the collage app to order prints of a new collage. Her mail account is open in another tab, and the collage app's sign-in page now has two buttons under the password form: Continue with your photo account, and Continue with your mail account. She chooses the mail button for the first time.
A row of buttons like that is usually called social sign-in, because the accounts behind them are ones people already use every day: a mailbox, a social network, a photo library. Supporting several providers registered a relying party at a second provider and gave it a configuration entry of its own, and Linking accounts showed how a second way in is attached to an account safely. What is left once those mechanics work is the rules the collage app sets for each button, and what happens to the people behind a button when its provider changes or goes away.
The word "social" describes what the person sees, not a lighter kind of sign-in. Behind the mail button is the same exchange the photo button uses, checked entirely against the mail service's entry: its 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., its key setA JSON document, published at a fixed HTTPS address, that lists an issuer's current public keys so others can verify its signatures. It never contains private keys., the client ID it issued to the collage app, and a nonceA random value used for one attempt only. In OpenID Connect, the client sends one in its sign-in request and checks that the same value comes back inside the ID token, showing the token answers this attempt., state and PKCEProof Key for Code Exchange, pronounced pixie: the client creates a secret for each authorization attempt, sends only a hash of it at the start, and proves it holds the secret when redeeming the code, so a stolen authorization code is useless to anyone else. verifier from Ava's own attempt. Nothing is skipped because the provider is a familiar consumer service. Decoded, the 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. from her sign-in looks like this:
{
"iss": "https://accounts.mail.example",
"sub": "a94f1c07e2",
"aud": "c2d7a915-4e8b-4f03-a6d2-7b19e5f80c4d",
"iat": 1790710200,
"exp": 1790710500,
"auth_time": 1790710181,
"nonce": "demo-nonce-21",
"name": "Ava Archer",
"email": "[email protected]",
"email_verified": true
}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. was issued at 19:30:00 UTC and expires five minutes later. Once it validates, the collage app holds a verified pair, https://accounts.mail.example and a94f1c07e2, and looks it up in its sign-in identities table. There is no row. This mail account has never opened a collage app account, and what happens next is no longer a question about tokens.
What the new button really changes is the number of ways into collage app accounts. Account 8812 already opens with Ava's password and with user-2048 at the photo service. A third entrance is convenient. It is also one more place where someone could try to get into an account that isn't theirs, and one more outside service the collage app depends on. Each entrance therefore gets its own answers to three questions: who it may let in for the first time, how much the app relies on what happened at the provider, and what the people who use it will do if it disappears.
Rules for each entrance
Those answers live in the provider's configuration entry, beside its issuer and client ID, and they can differ from one button to the next:
| Rule | Photo button | Mail button |
|---|---|---|
| A first sign-in from an unknown subject | May create an account, or connect an existing one | May only connect an existing account |
| Addresses allowed on new accounts | Any address the provider verified | None, while it creates no accounts |
| The provider's two-step sign-in counts as the app's own | No | No |
| Shown on the sign-in page | Yes | Yes |
The first row is the account policy. Creating an account is a legitimate choice, but it creates a collage app customer, not a copy of the mail account. The new account gets the app's default customer settings and inherits nothing from the mail service, whatever that account is allowed to do there. Connecting only is the cautious start for a new button: the people who use it already have collage app accounts, and nobody can arrive through it without one. Some relying parties go further and allow new accounts only for addresses in particular domains, which suits a button meant for one organization's staff and means little for a public mail service.
The third row is about 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. strength. The collage app asks for a second step before anyone changes a delivery address. An ID token can carry an amr claim, a list of the authentication methods the provider used, such as a password and a one-time code. If the mail service reports there that its own sign-in used two factors, the collage app could skip its own second step, but only if it trusts the mail service's second factor as much as its own and has agreed what the claim means, the question Authentication context and methods takes up. For a consumer mail service the app leaves this off, and a mail sign-in still meets the app's own second step when it matters.
The subject is also specific to this entry. The mail service issues pairwise subjects, so a94f1c07e2 identifies Ava only to the collage app's website registration. If the app later replaces that registration, or adds a phone app under a different one, the mail service may send a different subject for the same person, as Public and pairwise subject identifiers explained. A registration change at a provider is an account change in disguise, and the app plans it as one.
New account or an existing account
The collage app has started the mail button on connecting only, while it tries the button with customers who already have accounts. So Ava lands on a page that says this mail account isn't connected to a collage app account yet, with a single choice: sign in to her collage app account to connect it.
The page doesn't open account 8812. The token reports [email protected], which is the address on account 8812, and the mail service operates that mailbox, but neither fact connects the two accounts, for the reasons Linking accounts gave. Ava signs in to account 8812 with her password and confirms, and the app writes the link exactly as that lesson described, with a single-use confirmation and a notice to the address it confirmed itself. Her account now has three entrances:
Account 8812
Password: set
Sign-in identities
https://auth.photos.example user-2048 linked 2026-09-28 18:12 UTC
https://accounts.mail.example a94f1c07e2 linked 2026-09-29 19:31 UTCOnce the trial goes well, the collage app lets the mail button create accounts too. The change affects only first sign-ins. Ava's row is untouched, and her next mail sign-in opens account 8812 as before. A newcomer whose mail subject has no row is now offered a new collage app account, or a sign-in to connect an existing one. If that newcomer's verified address happens to match an existing account, the app still doesn't open it. It offers the same choice as to anyone else, and the existing account opens only after its own sign-in.
Because a policy change alters who can get in, the app treats it like any other security setting: an administrator makes it, the change is recorded with who made it and when, and the next first sign-in follows the new rule. Nothing about the policy travels in a token, so nothing a provider sends can change it.
Connects only
- Who arrives
- Ava's new mail subject
- Address matches 8812
- Yes
- The app shows
- A connect page
- Account 8812 opens
- After her password
Linked after her own sign-in
Creates accounts
- Who arrives
- A newcomer
- Address matches 8812
- Yes
- The app shows
- New account or connect
- Account 8812 opens
- After its own sign-in
A new customer, default settings
Provider unreachable
- Who arrives
- Any customer
- Address matches 8812
- Never checked
- The app shows
- Sign in another way
- Account 8812 opens
- With her password
Mail-only accounts are locked out
Nothing about the policy travels in a token, so nothing a provider sends can change it.
Plan for provider changes
One evening the mail service stops answering. A customer who chooses the mail button gets no response from accounts.mail.example, and the collage app shows a plain message: mail sign-in is unavailable right now, sign in another way. What it must not do is lower the bar while the evidence is missing. It doesn't open the account whose address matches, accept a profile it can't validate, or skip the nonce check until the provider recovers. Ava signs in with her password and finishes her order.
Later, the collage app's team decides to switch the mail button off for a while. Once the entry is disabled, a fresh mail sign-in is refused at the app before any redirect, with the same kind of message. The rows in the sign-in identities table stay where they are. Disabling an entrance is a change to the app's configuration, and switching it back on restores every existing link without anyone linking again.
Whether a disabled button locks anyone out depends on what else their account has. Ava's has a password and the photo sign-in, so nothing changes for her. A customer who registered through the mail button after it began creating accounts, and never set a password, has no way in. Before retiring a provider for good, the app finds the accounts whose only entrance is that provider and asks those customers to add a password or another provider while they can still sign in. For anyone it misses, recovery goes through the address the app confirmed itself, not through the provider that has gone.
Providers change in quieter ways too. A new signing key is routine, because the app reads the mail service's keys from its discovery documentA JSON document that an OpenID Provider publishes at a well-known address under its issuer, listing its endpoints, where to find its signing keys, and its supported features so clients can configure themselves from one value.. A new issuer is not. If the mail service ever moved to a different issuer identifier, every sign-in would arrive as an unknown pair, and the app would need a planned move of each row from the old issuer to the new one, agreed with the provider, rather than matching people up by email. The same is true when a pairwise subjectA 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. changes because the app's registration changed.
Removing a single link stays a sensitive change, as Linking accounts described: the app asks for fresh proof and refuses to remove the last way in. It is also separate from the app's relationship with the mail service. Deleting Ava's row tells the mail service nothing. If the app also asks the mail service to revokeCancelling a credential, token, certificate, or authenticator before it would expire, so that it is no longer accepted. Whether every copy stops working at once depends on how services check it. what it granted the app, and that call times out, the app treats the outcome as unknown and checks again, instead of telling Ava the connection is gone.
Before the button went live, and again before each policy change, the collage app's team tried cases like these:
| Case | Expected outcome |
|---|---|
| A returning customer with a linked row | The linked collage app account opens, under either policy |
| A new subject while the button connects only | A connect page, and no account opens until an existing account's own sign-in |
| A new subject once the button creates accounts | A new collage app account with default settings, or a connect page if the person chooses it |
| A new subject whose verified address matches an account | The same choices as any new subject, never the matching account |
| The provider disabled or unreachable | A clear refusal, and the other entrances still work |
| An account whose only entrance is the mail button | Found and contacted before the button is retired |
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
- Set a provider entrance's rules, then switch it off without locking anyone outSet Lab Mail's entrance to connect existing accounts only, see a new provider subject refused an account by email, link it with local proof, then disable the provider and sign in locally.