Skip to content

How can we do case-insensitive comparison for sub claim and id_token? #1126

Answered by zandbelt
studersi asked this question in Q&A
Discussion options

You must be logged in to vote

The spec https://openid.net/specs/openid-connect-core-1_0.html#IDToken says:

sub
REQUIRED. Subject Identifier. A locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client, e.g., 24400320 or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4. It MUST NOT exceed 255 ASCII characters in length. The sub value is a case sensitive string.

So the value of sub is case sensitive by definition. Upon receiving the userinfo response, the spec https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse dictates:

The sub Claim in the UserInfo Response MUST be verified to exactly match the sub Claim in the ID Token; if they do no…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@studersi
Comment options

Answer selected by studersi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants