-
-
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.
Examples updates, ClientContext.with_interactive method introduced, r…
…efactor auth
- Loading branch information
Showing
18 changed files
with
296 additions
and
64 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
from examples import acquire_token_by_username_password | ||
from office365.graph_client import GraphClient | ||
""" | ||
Creates a PowerPoint file | ||
""" | ||
|
||
from office365.graph_client import GraphClient | ||
from tests.graph_case import acquire_token_by_username_password | ||
|
||
client = GraphClient(acquire_token_by_username_password) | ||
|
||
remote_drive = client.me.drive.root | ||
pptx_file = remote_drive.create_powerpoint("sample.pptx").execute_query() | ||
print(f"File {pptx_file.web_url} has been uploaded") |
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
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,19 @@ | ||
""" | ||
Demonstrates how to login when the user may be prompted for input by the authorization server. | ||
For example, to sign in, perform multi-factor authentication (MFA), or to grant consent | ||
to more resource access permissions. | ||
Prerequisite: In Azure Portal, configure the Redirect URI of your | ||
"Mobile and Desktop application" as ``http://localhost``. | ||
https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#interactive-and-non-interactive-authentication | ||
""" | ||
|
||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_tenant, test_client_id, test_site_url | ||
|
||
ctx = ClientContext(test_site_url).with_interactive(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
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.