Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import adal
- import requests
- ## set variables
- username = 'username@email.com'
- password = 'user's password'
- authorization_url = 'https://login.microsoftonline.com/<tenant> id>/oauth2/authorize/'
- client_id = '624ac9bd-4c1c-4687-aec8-b56a8991cfb3' (sample)
- tenant_id = 'd85131e4-1763-42d6-b9c7-b6bad64b3a51' (sample)
- resource_uri = 'https://companyname.sharepoint.com/folder1/folder2/Documents link with spaces/Project Name with Spaces/'
- context = adal.AuthenticationContext(
- authorization_url,
- validate_authority = None,
- cache=None,
- api_version=None)
- token_response = context.acquire_token_with_username_password(
- resource_uri,
- username,
- password,
- client_id)
- .......
- .......
Add Comment
Please, Sign In to add comment