JonathanHolvey / sharepy

Simple SharePoint authentication for Python
GNU General Public License v3.0
175 stars 52 forks source link

Auth Failure: Can't get new session, old sessions work #17

Closed Kody-Quintana closed 3 years ago

Kody-Quintana commented 6 years ago

I've been using this module successfully for about a week and have been able to connect, download, and upload files. I recently added an option to my script to delete the old sp-session.pkl so when the script is run again the user must enter their credentials again instead of automatically loading the sp-session.pkl. Now when I attempt to authenticate a new session I receive the message:

Authentication Failure: AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password"

If I load a copy of the old sp-session.pkl it authenticates and works fine. Attempting to login with another user also fails, but logging in to sharepoint online in a web browser works fine. Any idea what could be causing this?

JonathanHolvey commented 6 years ago

Are you using exactly the same username and password as before when you created the session file?

Incidentally, you shouldn't need to delete the session file to start a new session. Just call sharepy.connect() again instead of sharepy.load().

Kody-Quintana commented 6 years ago

Yes, and my intention for adding an option for deleting the pkl file is that it stores the password in plaintext. My problem now is I have this working session file but I cannot create new sessions for myself or other users.

JonathanHolvey commented 6 years ago

You're not the only one with this issue it seems: #19.