Skip to content

Feature/configurable principal claims (Entra ID SSO fix)#202

Open
SaschaJohn wants to merge 2 commits intoapache:mainfrom
SaschaJohn:feature/configurable-principal-claims
Open

Feature/configurable principal claims (Entra ID SSO fix)#202
SaschaJohn wants to merge 2 commits intoapache:mainfrom
SaschaJohn:feature/configurable-principal-claims

Conversation

@SaschaJohn
Copy link
Copy Markdown

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.

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).
@jbonofre jbonofre self-requested a review March 30, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant