jasonrollins / shareplum

Pythonic SharePoint
MIT License
179 stars 96 forks source link

AADSTS50126: Error validating credentials due to invalid username or password #185

Open Dhyanesh97 opened 2 years ago

Dhyanesh97 commented 2 years ago

Username, password and URL are okay but it is still giving an error.

Traceback (most recent call last):
  File "test_upload.py", line 13, in <module>
    SharePoint().upload_file(file_dir_path, file_name, folder_name)
  File "/home/ubuntu/atlas/national_kpi_table/sharepoint.py", line 36, in upload_file
    self._folder = self.connect_folder(folder_name)
  File "/home/ubuntu/atlas/national_kpi_table/sharepoint.py", line 28, in connect_folder
    self.auth_site = self.auth()
  File "/home/ubuntu/atlas/national_kpi_table/sharepoint.py", line 22, in auth
    self.authcookie = Office365(SHAREPOINT_URL, username=USERNAME, password=PASSWORD).GetCookies()
  File "/home/ubuntu/atlas/national_kpi_table/venv/lib/python3.8/site-packages/shareplum/office365.py", line 88, in get_cookies
    sectoken = self.get_security_token(self.username, self.password)
  File "/home/ubuntu/atlas/national_kpi_table/venv/lib/python3.8/site-packages/shareplum/office365.py", line 80, in get_security_token
    raise Exception('Error authenticating against Office 365. Error from Office 365:', message[0].text)
Exception: ('Error authenticating against Office 365. Error from Office 365:', 'AADSTS50126: Error validating credentials due to invalid username or password.')
KevSchechner commented 2 years ago

I have the same error

with "Office365-REST-Python-Client" works