Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/docs/concepts/persisting-connection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ When you log in to Microsoft 365 in the CLI for Microsoft 365, the CLI will pers

Depending on the CLI for Microsoft 365 commands you have used, the CLI might persist some additional information. For example, when using commands that interact with SharePoint Online, the CLI will store the URL of your SharePoint Online tenant as well as its ID.

The CLI for Microsoft 365 stores its connection information in two JSON files located in the home directory of the current user. On MacOS and Linux, these are `~/.cli-m365-tokens.json` and `~/.cli-m365-msal.json`. On Windows, this is `<root>\Users\<username>\.cli-m365-tokens.json` and `<root>\Users\<username>\.cli-m365-msal.json`. The `tokens` file serves as a quick lookup of tokens to speed up command execution. The `msal` file is the cache of the `msal-node` library used by CLI for Microsoft 365 to authenticate to Microsoft 365. Contents of both these files are not encrypted.
The CLI for Microsoft 365 stores its connection information in JSON files located in the home directory of the current user. On macOS and Linux, the active connection is stored in `~/.cli-m365-connection.json` and all connections in `~/.cli-m365-all-connections.json`. On Windows, these are `<root>\Users\<username>\.cli-m365-connection.json` and `<root>\Users\<username>\.cli-m365-all-connections.json`. These files serve as a quick lookup of connection details to speed up command execution.

The MSAL token cache, which contains access and refresh tokens, is stored securely using the OS-specific credential store: macOS Keychain, Windows DPAPI, or Linux libsecret. If libsecret is unavailable on Linux, the CLI falls back to a plaintext file.

## Removing persisted connection information

Expand Down
Loading
Loading