Skip to content

Conversation

lunika
Copy link
Member

@lunika lunika commented Aug 22, 2025

Purpose

All ASCII characters are allowed in a sub, we change the sub validator to reflect this.

Proposal

  • 🐛(back) allow ASCII characters in user sub field

Fix #1280

@lunika lunika requested a review from AntoLC August 22, 2025 10:05
@lunika lunika self-assigned this Aug 22, 2025
@lunika lunika added the bug Something isn't working label Aug 22, 2025
@lunika lunika requested a review from qbey August 26, 2025 09:14
Copy link
Member

@qbey qbey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check:

  • add a changelog?
  • update migrations (no-op)?

We can merge it like this, but I wonder whether we should be less restrictive on the sub field, wdyt?

),
)

sub = models.CharField(
_("sub"),
help_text=_(
"Required. 255 characters or fewer. Letters, numbers, and @/./+/-/_/: characters only."
"Required. 255 characters or fewer. Letters, numbers, and @.+-_:=/ characters only."
Copy link
Member

@qbey qbey Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the OIDC spec says the sub can contain up to 255 ASCII characters (following RFC 20 https://www.rfc-editor.org/rfc/rfc20.txt)

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 [RFC20] characters in length. The sub value is a case-sensitive string.

Should we be less restrictive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we should remove the validator?

@lunika lunika force-pushed the fix/user-sub-validator branch from 0ea8aba to cd45ff6 Compare August 29, 2025 12:25
@lunika lunika changed the title 🐛(back) allow / and = characters in user sub field 🐛(back) allow ASCII characters in user sub field Aug 29, 2025
@lunika lunika requested a review from qbey August 29, 2025 12:26
@lunika
Copy link
Member Author

lunika commented Aug 29, 2025

@qbey ASCII characters are allowed now.

Copy link

github-actions bot commented Aug 29, 2025

Size Change: -9 B (0%)

Total Size: 3.6 MB

compressed-size-action

@lunika lunika force-pushed the fix/user-sub-validator branch 3 times, most recently from 64f8ae6 to d556403 Compare August 29, 2025 13:24
@lunika lunika enabled auto-merge (squash) August 29, 2025 13:25
All ASCII characters are allowed in a sub, we change the sub validator
to reflect this.
Fix #1280
@lunika lunika force-pushed the fix/user-sub-validator branch from d556403 to 4f3430e Compare August 29, 2025 13:28
@lunika lunika merged commit 09de014 into main Aug 29, 2025
27 of 29 checks passed
@lunika lunika deleted the fix/user-sub-validator branch August 29, 2025 13:59
@AntoLC AntoLC mentioned this pull request Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs incompatible with ADFS OIDC provider
2 participants