state comes back to you and presenting it
at the callback is what proves the two halves are one flow.
Google today. Adding a provider is a row and an implementation on our side —
never a migration, and never a change to the two calls below.
The OAuth application is yours
You register the application in Google’s console and store the credentials with us. The consent screen your customer reads then says your product’s name, not ours — an identity provider whose own brand appears on somebody else’s login screen is selling the wrong thing.A test environment with nothing configured may fall back to a shared
UserKit-owned application, so social sign-in works in your first ten minutes.
Live never does: that consent screen has to be yours.
GET /v1/config/{key}
answers with the providers this environment can actually sign someone in with,
so the button appears when you register the application and not when you next
deploy. See Auth modes.
Start
200
authorization_url and keep state where the callback page
can read it — session storage is the usual answer. The flow is good for fifteen
minutes.
PKCE is applied on every flow, and the verifier never leaves our process: the
authorization code travels through a page we do not control, so a stolen code
alone buys nothing.
Passing anonymous_id folds the visitor this person already was into the
account, attribution included.
Rate limited to 30 per hour per IP.
Callback
Your redirect page receives?code=… and posts it back with the state it kept:
200
401 invalid_grant. A provider we could not reach answers 502 provider_unavailable — that one is not your caller’s fault.
Rate limited to 30 per hour per IP.
How the account is resolved
This is the part worth reading twice. In order:1
A contact already linked to this provider account
Resolved by the provider’s stable subject id, never by the email. Somebody
who changes their Google address is still the same person.
2
The provider vouched for an address
It links onto the contact that owns that address, or creates one. Two
parties have now proved the same address, which is what makes linking
permissible at all.
3
The provider did not vouch
The provider account is the only identity the sign-in carries. The email
lands as an attribute and resolves to nothing — a new contact, even if the
address looks familiar.