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
def_get_instance_metadata(self): # This exists so it can be mocked in unit test
1053
+
resp=self.http_client.get(
1054
+
"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", # TBD: We may extend this to use self._instance_discovery endpoint
1055
+
headers={'Accept': 'application/json'})
1056
+
resp.raise_for_status()
1057
+
returnjson.loads(resp.text)['metadata']
1058
+
1015
1059
def_get_authority_aliases(self, instance):
1060
+
ifself._instance_discoveryisFalse:
1061
+
return []
1062
+
ifself.authority._is_known_to_developer:
1063
+
# Then it is an ADFS/B2C/known_authority_hosts situation
1064
+
# which may not reach the central endpoint, so we skip it.
instance_discovery_endpoint='https://{}/common/discovery/instance'.format( # Note: This URL seemingly returns V1 endpoint only
91
+
WORLD_WIDE# Historically using WORLD_WIDE. Could use self.instance too
92
+
# See https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/4.0.0/src/Microsoft.Identity.Client/Instance/AadInstanceDiscovery.cs#L101-L103
93
+
# and https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/4.0.0/src/Microsoft.Identity.Client/Instance/AadAuthority.cs#L19-L33
resp=http_client.get( # Note: This URL seemingly returns V1 endpoint only
150
-
'https://{}/common/discovery/instance'.format(
151
-
WORLD_WIDE# Historically using WORLD_WIDE. Could use self.instance too
152
-
# See https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/4.0.0/src/Microsoft.Identity.Client/Instance/AadInstanceDiscovery.cs#L101-L103
153
-
# and https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/4.0.0/src/Microsoft.Identity.Client/Instance/AadAuthority.cs#L19-L33
0 commit comments