-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#713: support for oauth2 device code auth introduced
- Loading branch information
Showing
6 changed files
with
216 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Demonstrates how to authenticate users on devices or operating systems that don't provide a web browser. | ||
Device code flow lets the user use another device such as a computer or a mobile phone to sign in interactively. | ||
https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code | ||
""" | ||
|
||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_tenant, test_client_id, test_site_url | ||
|
||
ctx = ClientContext(test_site_url).with_device_flow(test_tenant, test_client_id) | ||
me = ctx.web.current_user.get().execute_query() | ||
print(me.login_name) | ||
web = ctx.web.get().execute_query() | ||
print(web.title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.