openid is reviewed
before your client is approved, so ask for what you need and no more.
Scopes
openid is implicit — it is always included and cannot be removed.
Two claims are present on every authentication regardless of scope:
The subject (sub)
sub is a pairwise pseudonymous identifier: stable for a person within your organization,
and meaningless outside it.
Stable
The same person signing in to any of your applications always gets the same
sub, today and
in five years.Un-linkable
Their
sub at another sajn customer is a completely different value. The two cannot be
correlated, even by us.Irreversible
The personnummer cannot be derived from it. It is not a hash you can brute-force — the
mapping is server-side only.
The right user key
Store
sub. It is what identifies a returning user without you holding a national ID number.profile
birthdate is YYYY-MM-DD, derived from the personnummer and correct for coordination numbers
(samordningsnummer, where the day is offset by 60). You get a date of birth without
requesting nin, which is often all an age check needs.
nin
nin_typeis namespaced against a future where other countries’ identifiers appear. Do not assume the value.- It arrives in the
id_token, which lands in your logs if you log tokens. The access token is deliberately opaque for the same reason — so the personnummer is never sitting inside a bearer string in a proxy trace.
Full example
Anid_token payload with all three scopes:
One projection, every channel
The same claims appear in theid_token, from /oidc/userinfo, and in the
Session API result. There is no channel that reveals more than another, and
no way to widen the set after approval. The Session API returns every claim key in claims, with
null for a claim your client isn’t approved for.
Not included
- Address, company roles, income, property. Registry enrichment (SPAR, Bolagsverket, Skatteverket, Lantmäteriet) needs separate data licences and is not part of sajn Login.
- Email and phone. BankID does not provide them. Collect them yourself if you need them.
- Anything the user typed. Every claim originates from BankID, which is the point.

