You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks a lot for this library!
I was trying this out to connect to SharePoint Online with Python but I directly got an error.
The code:
from client.auth.AuthenticationContext import AuthenticationContext
from client.ClientContext import ClientContext
from settings import settings
url = "https://mycompany.sharepoint.com/"
username = "yenthe.vanginneken@mycompany.onmicrosoft.com"
password = "password"
ctxAuth = AuthenticationContext(url)
if ctxAuth.acquireTokenForUser(username, password):
request = ClientRequest(url,ctxAuth)
requestUrl = "/_api/web/" #Web resource endpoint
data = request.executeQuery(requestUrl=requestUrl)
webTitle = data['d']['Title']
print "Web title: {0}".format(webTitle)
else:
print ctxAuth.getLastErrorMessage()
I've added this to a Python file named connector.py. When executing this code I will get the error:
An error occured while retrieving token: The entered and stored passwords do not match.
So, why am I getting this and how should I fix this? On a sidenote: what is the correct way to install this library in Linux? I've now manually downloaded it and added it in the same folder where my connector.py file is but I know thats not really the good way.
Thanks,
Yenthe
The text was updated successfully, but these errors were encountered:
Found the issue.
I had the username: username = "yenthe.vanginneken@mycompany.onmicrosoft.com" and this should be username = "yenthe.vanginneken@mycompany.be"
Hi @vgrem,
First of all, thanks a lot for this library!
I was trying this out to connect to SharePoint Online with Python but I directly got an error.
The code:
I've added this to a Python file named connector.py. When executing this code I will get the error:
So, why am I getting this and how should I fix this? On a sidenote: what is the correct way to install this library in Linux? I've now manually downloaded it and added it in the same folder where my connector.py file is but I know thats not really the good way.
Thanks,
Yenthe
The text was updated successfully, but these errors were encountered: