Library that allows logging into Microsoft accounts via requests
ms-session is a tiny Python library that provides a way to log in to your Microsoft account programatically in a
Session. It is widely unknown why you would ever want to use this, but that's for you to determine. I just make the library.
The usage is incredibly simple and straightforward. Just create a new
MSSession object and pass it your creds.
from ms_session import MSSession session = MSSession("email@example.com", "password")
The returned object is a subclass of
requests.Session and has you logged in to your Microsoft account.
"firstname.lastname@example.org" in session.get("https://account.microsoft.com/") # True
- Rarely (it seems to occur for Microsoft accounts that have not been logged into for a very long time), a required key may be missing from an API response that is required to be passed to the next. This will prevent you from logging in using
ms-session. There may be a way further traverse the chain of requests needed to log in, but I have found that logging in to that account manually once seems to get it back in shape to be used with
ms-session. If you figure anything out about combatting this, feel free to submit a PR
- Accounts protected by two-factor auth are not supported, and I have no plans to do so ever
A huge thank you to @Terrance and his SkPy library. He and his library were able to point me in the correct direction for understadning how tricky values such as
The Chromium Dev Tools are your best friend when it comes to reversing services. Do not sleep on them.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for ms_session-1.0.0-py3-none-any.whl