Skip to content

Commit f1243f2

Browse files
authored
Fetching device code endpoint from discovery (#245)
* Extracting device_endpt from discovery
1 parent 0ae4e9f commit f1243f2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

msal/application.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def _build_client(self, client_credential, authority):
235235
"authorization_endpoint": authority.authorization_endpoint,
236236
"token_endpoint": authority.token_endpoint,
237237
"device_authorization_endpoint":
238+
authority.device_authorization_endpoint or
238239
urljoin(authority.token_endpoint, "devicecode"),
239240
}
240241
return Client(

msal/authority.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def __init__(self, authority_url, http_client, validate_authority=True):
9292
logger.debug("openid_config = %s", openid_config)
9393
self.authorization_endpoint = openid_config['authorization_endpoint']
9494
self.token_endpoint = openid_config['token_endpoint']
95+
self.device_authorization_endpoint = openid_config.get('device_authorization_endpoint')
9596
_, _, self.tenant = canonicalize(self.token_endpoint) # Usually a GUID
9697
self.is_adfs = self.tenant.lower() == 'adfs'
9798

0 commit comments

Comments
 (0)