OIDC: scoped sub with client_credentials?

Simon Lundström simlu at su.se
Mon Nov 9 10:02:25 UTC 2026


On Fri, 2026-11-06 at 17:20:25 +0100, Scott Cantor wrote:
> I'm going mostly from memory and the docs I wrote as I don't have time to look at the code today, but IIRC, the sub claim in the client_credentials grant is pretty specifically "the client", i.e. not a "user".
> 
> It comes from the canonicalized name of the client after it passes through the client authentication flow, so you get a subject c14n step in there as with normal authentication, so it's possible to transform it, but otherwise it's basically the client_id.

That makes total sense and yes it's just in my small world that the
client id when using client_credentials basically is a service account
that's connecting to an API.

> It is, IIRC, not at all coming from the resolver the way it normally does.

That was my feeling too but I had no knowledge to back it up with.

> That's from memory and my memory is probably faulty, but the docs at least say some of that.
> 
> I don't know whether it's even possible to override it other than through subject c14n transformation.

Since most people might use an URI or a string it would also be possible
via c14n transformation to use a translate map between client_ids and an
internal service account (probably via a subject decorator[1]?) right?

> And obviously, a scoped client_id is possible but not typical. For us, client_ids should always be URIs and for the rest of the world, they're just non-unique strings. Scoping them isn't crazy, but it would have to probably come from the c14n step at this point.

You still have to know/check which iss it comes from so that's basically
the "scope" (not really but close enough).

Thanks for making it sane!

BR,
- Simon

1,
<https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199505085/AuthenticationConfiguration#Subject-Decorators>


More information about the users mailing list