Skip to content

Encrypt tokens! #63

Closed
Closed

Description

Any particular reason why you are storing the tokens in unencrypted form on the hard drive? Hardly the best security practice.

I understand that you might be using this for ensuring session longevity and such, but at least store them as secure string, or use the cred man or something. On a related note, why arent you leveraging the ADAL/MSAL token cache?

AB#4594

Activity

  1. darrelmiller commented on Dec 3, 2019

    @darrelmiller
    Contributor

    Thanks for calling this out. We had tokens being encrypted on Windows, but we didn't have it working on Linux/OSX because there was no support for it in MSAL. Peter Ombwa (@peombwa) worked on adding support for encrypting tokens on Linux last week and we expect to be able to add encryption back very soon.

    We are using the MSAL Token cache. We access it here https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Authentication/Authentication/Helpers/AuthenticationHelpers.cs#L48

  2. added
    enhancement
    and removed on Dec 3, 2019
  3. added this to the 0.2.0 milestone on Dec 3, 2019
  4. michevnew commented on Dec 3, 2019

    @michevnew
    Author

    I actually noticed this on a Windows machine. The userTokenCache.bin3 is created in the assembly directory and contains the unencrypted tokens, you can simply copy/paste it for use in auth header outside of the Graph module. Using 0.1.4 if it matters.

    As long as you are aware of this an plan to address it, I'm fine :)

  5. darrelmiller commented on Dec 3, 2019

    @darrelmiller
    Contributor

    I'm not sure why we needed to remove it temporarily for Windows, but I do know that this is high on our priority to fix.

  6. peombwa commented on Dec 3, 2019

    @peombwa
    Member

    We had to temporarily remove it for Windows because System.Security.Cryptography.ProtectedData - DPAPI - doesn't support PowerShell 5 (.Net 4.5). This is something high on our priority list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions