You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add knownAuthorities check to issuer validation for CIAM GUID-based issuer URL (#8595)
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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lalimasharda <26092202+lalimasharda@users.noreply.github.com>
"comment": "Add issuer validation Rule 5: accept issuer hosts explicitly listed in knownAuthorities. Fixes Entra External ID (CIAM) regression where a GUID-based issuer is returned for a name-based authority [#8592](https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/8592)",
|`clientId`| App ID of your application. Can be found in your [portal registration](../README#prerequisites). | UUID/GUID | None. This parameter is required in order for MSAL to perform any actions. |
76
76
|`authority`| URI of the tenant to authenticate and authorize with. Usually takes the form of `https://{uri}/{tenantid}` (see [Authority](../../msal-common/docs/authority.md)) | String in URI format with tenant - `https://{uri}/{tenantid}`|`https://login.microsoftonline.com/common`|
77
-
|`knownAuthorities`| An array of URIs that are known to be valid. Used in B2C scenarios. | Array of strings in URI format| Empty array `[]`|
77
+
|`knownAuthorities`| An array of known authority URIs. Used in B2C and CIAM scenarios. For CIAM with Entra External ID, include the GUID-based issuer host if it differs from the authority host (see [Authority - CIAM](../../msal-common/docs/authority.md#ciam-issuer-validation-and-knownauthorities)). | Array of strings in URI format | Empty array `[]`|
78
78
|`cloudDiscoveryMetadata`| A string containing the cloud discovery response. Used in AAD scenarios. See [Performance](../../msal-common/docs/performance.md) for more info | string | Empty string `""`|
79
79
|`authorityMetadata`| A string containing the .well-known/openid-configuration endpoint response. See [Performance](../../msal-common/docs/performance.md) for more info | string | Empty string `""`|
80
80
|`redirectUri`| URI where the authorization code response is sent back to. Whatever location is specified here must have the MSAL library available to handle the response. | String in absolute or relative URI format | Login request page (`window.location.href` of page which made auth request) |
// src/authority/Authority.ts:694:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4840
4840
// src/authority/Authority.ts:805:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4841
4841
// src/authority/Authority.ts:1003:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4842
-
// src/authority/Authority.ts:1218:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4842
+
// src/authority/Authority.ts:1223:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4843
4843
// src/authority/AuthorityOptions.ts:25:5 - (ae-forgotten-export) The symbol "CloudInstanceDiscoveryResponse" needs to be exported by the entry point index.d.ts
4844
4844
// src/cache/CacheManager.ts:355:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4845
4845
// src/cache/CacheManager.ts:356:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
Copy file name to clipboardExpand all lines: lib/msal-common/docs/authority.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,32 @@ Where `tenant` would mean:
133
133
- GUID (tenantId)
134
134
- a verified domain for the tenant
135
135
136
-
Note: MSAL JS currently is previeing the `CIAM` support. This is an emerging space and there could be some changes to the support until we GA the feature.
136
+
#### CIAM Issuer Validation and `knownAuthorities`
137
+
138
+
The Entra External ID (CIAM) service may return an OIDC issuer whose host uses the **tenant GUID** rather than the tenant name. For example, an authority configured as `https://contoso.ciamlogin.com/contoso.onmicrosoft.com/` may return an issuer of the form:
Because the issuer host (`<tenant-guid>.ciamlogin.com`) differs from the authority host (`contoso.ciamlogin.com`) and MSAL JS does not have a reliable way to know the mapping beforehand, MSAL's issuer validation will reject it unless the GUID-based host is explicitly trusted. To resolve this, add the GUID-based host to `knownAuthorities`:
"<tenant-guid>.ciamlogin.com"// Add the GUID-based issuer host
154
+
]
155
+
}
156
+
});
157
+
```
158
+
159
+
You can find your tenant GUID in the Azure portal under **Tenant properties** or by inspecting the OIDC discovery document at `https://<tenantName>.ciamlogin.com/<tenantName>.onmicrosoft.com/v2.0/.well-known/openid-configuration`.
160
+
161
+
Note: MSAL JS currently is previewing the `CIAM` support. This is an emerging space and there could be some changes to the support until we GA the feature.
0 commit comments