Skip to content

⚠️ Auth: Change principal name to subject identifier#62

Merged
vlaurin merged 1 commit intomainfrom
fix/nullsafe-principal-name
Jan 30, 2026
Merged

⚠️ Auth: Change principal name to subject identifier#62
vlaurin merged 1 commit intomainfrom
fix/nullsafe-principal-name

Conversation

@vlaurin
Copy link
Copy Markdown
Contributor

@vlaurin vlaurin commented Jan 30, 2026

It is not valid for a principal name to be null or empty. As such, relying on name claims which can be null or empty is not acceptable. Instead, the subject identifier (sub claim) should be used as it cannot be null or empty as per the OAuth2 spec.

Breaking change

Consumers using authentication.getName() as a way to retrieve a user's display name must change to authentication.getUserInfo().getName().

It is not valid for a principal name to be null or empty. As such, relying on name claims which can be null or empty is not acceptable.
Instead, the subject identifier (`sub` claim) should be used as it cannot be null or empty as per the OAuth2 spec.
@vlaurin vlaurin requested a review from gbenadikar January 30, 2026 15:43
@vlaurin vlaurin added the type:breaking Breaking change label Jan 30, 2026
@vlaurin vlaurin merged commit abaaf55 into main Jan 30, 2026
2 checks passed
@vlaurin vlaurin deleted the fix/nullsafe-principal-name branch January 30, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:breaking Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants