Skip to content

An error occured while retrieving token: The entered and stored passwords do not match. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Yenthe666 opened this issue Feb 22, 2016 · 1 comment

Comments

@Yenthe666
Copy link
Contributor

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:

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

@Yenthe666
Copy link
Contributor Author

Found the issue.
I had the username:
username = "yenthe.vanginneken@mycompany.onmicrosoft.com" and this should be username = "yenthe.vanginneken@mycompany.be"

vgrem added a commit that referenced this issue Oct 5, 2023
vgrem added a commit that referenced this issue Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant