We should consider simplifying how we persist login state and store the retrieved access- and refresh tokens in a plain-text file, just like the Azure CLI does.
After signing in to Office 365, we retrieve an access- and a refresh token. We persist both in a OS-specific credential store (Key Chain on macOS, Credential Manager on Windows, plain text file on disk on Linux). Handling OS-specific implementation adds complexity to our code and is error-prone.
In comparison, Azure CLI stores credentials on disk in a plain text file located at ~/.azure/azureProfile.json and it does that for every OS.
Given that using the OS-specific credential store offers no added value, we should consider simplifying our implementation and use an approach similar to the Azure CLI.
We should consider simplifying how we persist login state and store the retrieved access- and refresh tokens in a plain-text file, just like the Azure CLI does.
After signing in to Office 365, we retrieve an access- and a refresh token. We persist both in a OS-specific credential store (Key Chain on macOS, Credential Manager on Windows, plain text file on disk on Linux). Handling OS-specific implementation adds complexity to our code and is error-prone.
In comparison, Azure CLI stores credentials on disk in a plain text file located at
~/.azure/azureProfile.jsonand it does that for every OS.Given that using the OS-specific credential store offers no added value, we should consider simplifying our implementation and use an approach similar to the Azure CLI.