Feature/configurable principal claims (Entra ID SSO fix)#202
Open
SaschaJohn wants to merge 2 commits intoapache:mainfrom
Open
Feature/configurable principal claims (Entra ID SSO fix)#202SaschaJohn wants to merge 2 commits intoapache:mainfrom
SaschaJohn wants to merge 2 commits intoapache:mainfrom
Conversation
Adds VITE_OIDC_PRINCIPAL_CLAIMS env variable (comma-separated list) to control which JWT claims are used to resolve the Polaris principal name and in what priority order. Default behaviour is unchanged: sub,principal,principal_name,name. Identity providers like Entra ID / Azure AD issue an opaque pairwise sub claim that does not match human-readable principal names. Operators can now set: VITE_OIDC_PRINCIPAL_CLAIMS=preferred_username,email,sub,name to prefer the UPN/email instead, without code changes.
The generate-config.sh entrypoint script was not forwarding the new VITE_OIDC_PRINCIPAL_CLAIMS env variable into window.APP_CONFIG, so the browser always fell back to the build-time default (sub first).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds VITE_OIDC_PRINCIPAL_CLAIMS env variable (comma-separated list) to control which JWT claims are used to resolve the Polaris principal name and in what priority order.
Default behaviour is unchanged: sub,principal,principal_name,name.
Identity providers like Entra ID / Azure AD issue an opaque pairwise sub claim that does not match human-readable principal names.
The problem here is Entra ID always has a sub set and
utils.js tries it always as first precedence:
// Try common JWT claim names for the principal/subject
return (
(decoded.sub as string) ||
(decoded.principal as string) ||
(decoded.principal_name as string) ||
(decoded.name as string) ||
null
Operators can now set:
VITE_OIDC_PRINCIPAL_CLAIMS=preferred_username,email,sub,name
to prefer the UPN/email instead, without code changes.