Replies: 3 comments 4 replies
-
Unfortunately there is no way to encrypt tokens in any way in a client tool that's open source. Whatever mechanism, we'd implement, anyone could reverse engineer. At some point we used Windows Credential Manager and Keychain to store credentials but since any application can access them, it wouldn't protect the credentials in any way. |
Beta Was this translation helpful? Give feedback.
-
Hi, Windows Credential Manager and Keychain is also better than having clear texts lying around. What do you think? br, |
Beta Was this translation helpful? Give feedback.
-
How does using either of these capabilities prevent any other app from accessing the credentials? One thing that's different with PowerShell comparing to other shells is that it has the notion of a session, where you could theoretically sign in, store credentials in the session without persisting them on disk, and reuse them across cmdlets. Unfortunately, as far as I know, this is not possible in other shells and persisting credentials on disk is the only way to reuse them across multiple commands. |
Beta Was this translation helpful? Give feedback.
-
Hello @pnp/cli-for-microsoft-365-maintainers,
the CLI is storing the cli msal and tokens information on my user directory.
I can open these files and see all values in clear text. I can also find the refresh token in clear text. I can take these files and copy them to another machine. I haven't it tried yet but in theory I could then continue on that machine without being required to login again. This might become a security vulnerability to my understanding.
My suggestion would be to encrypt the file on filesystem based on userid and machine name.
What are your thoughts?
Beta Was this translation helpful? Give feedback.
All reactions