Skip to content

fix: add knownAuthorities check to issuer validation for CIAM GUID-based issuer URL#8595

Merged
lalimasharda merged 8 commits into
devfrom
fix/ciam-issuer-known-authorities
May 22, 2026
Merged

fix: add knownAuthorities check to issuer validation for CIAM GUID-based issuer URL#8595
lalimasharda merged 8 commits into
devfrom
fix/ciam-issuer-known-authorities

Conversation

@lalimasharda
Copy link
Copy Markdown
Contributor

@lalimasharda lalimasharda commented May 19, 2026

Entra External ID (CIAM) may return an OIDC issuer with the tenant GUID as the host (e.g. https://.ciamlogin.com//v2.0) even when the authority was configured with a tenant name. The existing issuer validation rules only match against the authority host or hardcoded Microsoft hosts, causing endpoints_resolution_error for CIAM tenants.

Changes:

  • Add Rule 5 to validateIssuer: accept issuers whose HTTPS host is explicitly listed in the developer-configured knownAuthorities
  • Refactor isInKnownAuthorities to accept a host parameter so it can be reused for both cloud discovery and issuer validation
  • Add unit tests for Rule 5 (accept, reject, reject-HTTP)
  • Update CIAM docs in authority.md with workaround guidance
  • Update knownAuthorities description in configuration.md

Fixes #8592

…sed issuers

Entra External ID (CIAM) may return an OIDC issuer with the tenant GUID
as the host (e.g. https://<guid>.ciamlogin.com/<guid>/v2.0) even when
the authority was configured with a tenant name. The existing issuer
validation rules only match against the authority host or hardcoded
Microsoft hosts, causing endpoints_resolution_error for CIAM tenants.

Changes:
- Add Rule 5 to validateIssuer: accept issuers whose HTTPS host is
  explicitly listed in the developer-configured knownAuthorities
- Refactor isInKnownAuthorities to accept a host parameter so it can
  be reused for both cloud discovery and issuer validation
- Add unit tests for Rule 5 (accept, reject, reject-HTTP)
- Update CIAM docs in authority.md with workaround guidance
- Update knownAuthorities description in configuration.md

Fixes #8592

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lalimasharda lalimasharda requested a review from a team as a code owner May 19, 2026 19:31
Copilot AI review requested due to automatic review settings May 19, 2026 19:31
@lalimasharda lalimasharda changed the title fix: add knownAuthorities check to issuer validation for CIAM GUID-ba… fix: add knownAuthorities check to issuer validation for CIAM GUID-based issuer URL May 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR fixes CIAM issuer validation failures when Entra External ID returns a GUID-based issuer host by allowing HTTPS issuer hosts explicitly listed in knownAuthorities.

Changes:

  • Add issuer validation Rule 5 to accept HTTPS issuer hosts in knownAuthorities.
  • Refactor isInKnownAuthorities to accept a host parameter and reuse it in multiple validation paths.
  • Update docs and add unit tests around the new Rule 5 behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/msal-common/src/authority/Authority.ts Adds Rule 5 issuer validation and refactors isInKnownAuthorities(host) for reuse.
lib/msal-common/test/authority/Authority.spec.ts Adds unit tests for Rule 5 knownAuthorities-based issuer validation.
lib/msal-common/docs/authority.md Documents CIAM GUID-based issuer behavior and knownAuthorities workaround.
lib/msal-browser/docs/configuration.md Updates knownAuthorities description to include CIAM guidance.
change/@azure-msal-common-24675ece-0d4f-478d-a1ec-415b970a0bb8.json Adds changelog entry for the patch release.

Comment thread lib/msal-common/src/authority/Authority.ts
Comment thread lib/msal-common/src/authority/Authority.ts Outdated
Comment thread lib/msal-browser/docs/configuration.md
Comment thread lib/msal-common/test/authority/Authority.spec.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
lalimasharda and others added 2 commits May 19, 2026 12:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ration.md type, add HTTP rejection test

Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-js/sessions/1930f599-2e2e-444b-af52-bc01c2bc5049

Co-authored-by: lalimasharda <26092202+lalimasharda@users.noreply.github.com>
Comment thread lib/msal-browser/docs/configuration.md Outdated
Co-authored-by: Lalima Sharda <lalima.sharda@gmail.com>
Comment thread lib/msal-common/src/authority/Authority.ts Outdated
@lalimasharda
Copy link
Copy Markdown
Contributor Author

@copilot fix formatting error in build

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

@copilot fix formatting error in build

Fixed in commit 3432612. Applied prettier formatting to combine the two-line condition into a single line as required by the project's code style.

@lalimasharda lalimasharda merged commit cf5eb29 into dev May 22, 2026
72 checks passed
@lalimasharda lalimasharda deleted the fix/ciam-issuer-known-authorities branch May 22, 2026 17:26
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.

@azure/msal-browser rejects valid Entra External ID OIDC issuer for tenant.ciamlogin.com/tenant.onmicrosoft.com authorities

5 participants