Microsoft Authentication extensions for MSAL Python provides a TokenCache that can persist your tokens on disk, protected by encryption on Windows, macOS and Linux.
By chatting or signing in you agree to the Terms and chat-message logging (revocable in History).