Guest User

Untitled

a guest
Feb 1st, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import adal
  2. import requests
  3. ## set variables
  4. username = 'username@email.com'
  5. password = 'user's password'
  6. authorization_url = 'https://login.microsoftonline.com/<tenant> id>/oauth2/authorize/'
  7. client_id = '624ac9bd-4c1c-4687-aec8-b56a8991cfb3' (sample)
  8. tenant_id = 'd85131e4-1763-42d6-b9c7-b6bad64b3a51' (sample)
  9. resource_uri = 'https://companyname.sharepoint.com/folder1/folder2/Documents link with spaces/Project Name with Spaces/'
  10.  
  11. context = adal.AuthenticationContext(
  12. authorization_url,
  13. validate_authority = None,
  14. cache=None,
  15. api_version=None)
  16.  
  17. token_response = context.acquire_token_with_username_password(
  18. resource_uri,
  19. username,
  20. password,
  21. client_id)
  22. .......
  23. .......
Add Comment
Please, Sign In to add comment