Skip to content

Commit d226142

Browse files
authored
Changing B2C implementation to verify policy format (#114)
1 parent 6e8be70 commit d226142

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

msal/authority.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def __init__(self, authority_url, validate_authority=True,
4848
self.proxies = proxies
4949
self.timeout = timeout
5050
authority, self.instance, tenant = canonicalize(authority_url)
51-
is_b2c = any(self.instance.endswith("." + d) for d in WELL_KNOWN_B2C_HOSTS)
51+
parts = authority.path.split('/')
52+
is_b2c = any(self.instance.endswith("." + d) for d in WELL_KNOWN_B2C_HOSTS) or (
53+
len(parts) == 3 and parts[2].lower().startswith("b2c_"))
5254
if (tenant != "adfs" and (not is_b2c) and validate_authority
5355
and self.instance not in WELL_KNOWN_AUTHORITY_HOSTS):
5456
payload = instance_discovery(

0 commit comments

Comments
 (0)