Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Document the possible failure in Device Flow
  • Loading branch information
rayluo committed Dec 21, 2018
commit 7fef8f99b4e7a650f41baee78daf46484dff79e6
3 changes: 3 additions & 0 deletions msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ def initiate_device_flow(self, scopes=None, **kwargs):
:param list[str] scopes:
Scopes requested to access a protected API (a resource).
:return: A dict representing a newly created Device Flow object.

- A successful response would contain "user_code" key, among others
- an error response would contain some other readable key/value pairs.
"""
return self.client.initiate_device_flow(
scope=decorate_scope(scopes or [], self.client_id),
Expand Down
1 change: 1 addition & 0 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def test_device_flow(self):
self.app = PublicClientApplication(
CONFIG["client_id"], authority=CONFIG["authority"])
flow = self.app.initiate_device_flow(scopes=CONFIG.get("scope"))
assert "user_code" in flow, str(flow) # Provision or policy might block DF
logging.warn(flow["message"])

duration = 30
Expand Down