The OpenID Connect (OIDC) 'sub' claim is surprisingly load-bearing
OIDC (OpenID Connect) is today's better or best regarded standard for (web-based) authentication. When a website (or something) authenticates you through an OpenID (identity) Provider (OP), one of the things it gets back is a bunch of 'claims', which is to say information about the authenticated person. One of the core claims is 'sub', which is vaguely described as a string that is 'subject - identifier for the end-user at the issuer'. As I discovered today, this claim is what I could call 'load bearing' in a surprising way or two.
In theory, 'sub' has no meaning beyond identifying the user in some
opaque way. The first way it's load bearing is that some OIDC client
software (a 'Relying Party (RP)') will assume that the 'sub' claim
has a human useful meaning. For example, the Apache OpenIDC module defaults to putting
the 'sub' claim into Apache's REMOTE_USER
environment variable.
This is fine if your OIDC IdP software puts, say, a login name into
it; it is less fine if your OIDC IdP software wants to create 'sub'
claims that look like 'YXVzZXIxMi5zb21laWRw'. These claims mean
something to your server software but not necessarily to you and
the software you want to use on (or behind) OIDC RPs.
The second and more surprising way that the 'sub' claim is load bearing involves how external consumers of your OIDC IdP keep track of your people. In common situations your people will be identified and authorized by their email address (using some additional protocols), which they enter into the outside OIDC RP that's authenticating against your OIDC IdP, and this looks like the identifier that RP uses to keep track of them. However, at least one such OIDC RP assumes that the 'sub' claim for a given email address will never change, and I suspect that there are more people who either quietly use the 'sub' claim as the master key for accounts or who require 'sub' and the email address to be locked together this way.
This second issue makes the details of how your OIDC IdP software generates its 'sub' claim values quite important. You want it to be able to generate those 'sub' values in a clear and documented way that other OIDC IdP software can readily duplicate to create the same 'sub' values, and that won't change if you change some aspect of the OIDC IdP configuration for your current software. Otherwise you're at least stuck with your current OIDC IdP software, and perhaps with its exact current configuration (for authentication sources, internal names of things, and so on).
(If you have to change 'sub' values, for example because you have to migrate to different OIDC IdP software, this could go as far as the outside OIDC RP basically deleting all of their local account data for your people and requiring all of it to be entered back from scratch. But hopefully those outside parties have a better procedure than this.)
|
|