We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4015bf6 commit b469535Copy full SHA for b469535
msal/authority.py
@@ -237,9 +237,12 @@ def has_valid_issuer(self):
237
238
# Case 3: Regional variant check - O(1) lookup
239
# e.g., westus2.login.microsoft.com -> extract "login.microsoft.com"
240
- if any(issuer_host.endswith("." + trusted) for trusted in TRUSTED_ISSUER_HOSTS):
241
- return True
242
-
+ dot_index = issuer_host.find(".")
+ if dot_index > 0:
+ potential_base = issuer_host[dot_index + 1:]
243
+ if potential_base in TRUSTED_ISSUER_HOSTS and "." not in issuer_host[:dot_index]:
244
+ return True
245
+
246
# Case 4: Same scheme and host (path can differ)
247
if (authority_parsed.scheme == issuer_parsed.scheme and
248
authority_parsed.netloc == issuer_parsed.netloc):
0 commit comments