Skip to content

Commit

Permalink
Use provided authority port when building the tenant discovery endpoi…
Browse files Browse the repository at this point in the history
…nt (#484)

* Use provided authority port when building the tenant discovery endpoint

* address PR comment

* Polish the implementation

Co-authored-by: Ray Luo <[email protected]>
  • Loading branch information
sarathys and rayluo authored Jun 29, 2022
1 parent 053af22 commit 5935f0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion msal/authority.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ def __init__(self, authority_url, http_client, validate_authority=True):
tenant_discovery_endpoint = payload['tenant_discovery_endpoint']
else:
tenant_discovery_endpoint = (
'https://{}{}{}/.well-known/openid-configuration'.format(
'https://{}:{}{}{}/.well-known/openid-configuration'.format(
self.instance,
443 if authority.port is None else authority.port,
authority.path, # In B2C scenario, it is "/tenant/policy"
"" if tenant == "adfs" else "/v2.0" # the AAD v2 endpoint
))
Expand Down

0 comments on commit 5935f0b

Please sign in to comment.