sub claim vs upn claim #315
-
Hi I've read the spec and I still don't understand what's the point of the "upn". The MP-JWT spec says: "upn": A human readable claim that uniquely identifies the subject or user principal of the token, across the MicroProfile services the token will be accessed with. The JWT spec says: The "sub" (subject) claim identifies the principal that is the subject of the JWT. The claims in a JWT are normally statements about the subject. The subject value MUST either be scoped to be locally unique in the context of the issuer or be globally unique. The processing of this claim is generally application specific. The "sub" value is a case-sensitive string containing a StringOrURI value. Use of this claim is OPTIONAL. If understand this correctly then the only difference is that a upn has to be only unique accross the services the token will be accessed with; contrary to sub that can be unique in the context of the issuer or globally. So what does globally mean? Does globally mean that it must be something like an Email or a (hopefully) unique UUID? What would be an example for a UPN then? It could of course also be an Email as well because if it is globally unique then it is also unique across the services the token will be accessed with. But why can't it just be a sub claim then? Because there might be different issuers? Do you have a practical example for this? What would be the reason to have multiple issuers? And if you have: how can you assure that the value is unique across all of them? Because they are all controlled by the same company? Can someone give me a concrete example where you would have either a sub claim AND a upn or only a upn? Thanks and regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi @olijaun
|
Beta Was this translation helpful? Give feedback.
-
Hi @sberyozkin Thank for your response. Now you're confusing me even more. You say that upn is more analogous to preferred_username. The OpenID Spec says: "Therefore, other Claims such as [...] preferred_username and[sic] MUST NOT be used as unique identifiers for the End-User." The MP-JWT spec says that the upn is "A human readable claim that uniquely identifies the subject or user principal of the token, across the MicroProfile services the token will be accessed with." So it doesn't seem to me that they are analogous. ups has to be unique but preferred_username doesn't have to. "sub" has to be locally unique... whatever this means exactly. But I still don't see the need for UPN. If you need something unique there is the "sub" claim. If you need something like a username then us use "preferred_username" (which is part of the OpenID standard). Why is there a need for UPN? Regards |
Beta Was this translation helpful? Give feedback.
@olijaun sorry, misread your comment. So, yes, it is an MP JWT specific claim, it does not have to be used if the oidc claims specified in the fallback spec text are available. It was an attempt I guess to standardise when tokens are not produced by OIDC providers