Giter Site home page Giter Site logo

[Feature Request] Use credential manager instead of local file store for token caching on Windows platforms about microsoft-authentication-extensions-for-dotnet HOT 4 CLOSED

azuread avatar azuread commented on July 22, 2024
[Feature Request] Use credential manager instead of local file store for token caching on Windows platforms

from microsoft-authentication-extensions-for-dotnet.

Comments (4)

bgavrilMS avatar bgavrilMS commented on July 22, 2024

Hi @brphelps,

MSAL does not store un-encrypted data on disk, ever.

On UWP, we store the data encrypted with DPAPI https://docs.microsoft.com/en-us/dotnet/standard/security/how-to-use-data-protection.

On .NET Fwk, .NET Core, .NET 5, we don't store the token cache at all, because storing it in a file is not appropriate for web site scenarios. Users need to provide their own token cache storage implementation. For PublicCLientApps (e.g. desktop), we suggest you use this cross-plat cache persistence strategy: https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet, which stores the data as follows:

  • Windows - DPAPI
  • Mac - KeyChain
  • Linux - KeyRing

Note that we used to store tokens in WinCredManager, however this has a bunch of limitations, especially when it comes to size of keys etc. Tokens are not passwords, they are fairly long (2-3k chars) and would break WinCredsManager.

AFAIK (and MSALs are reviewed by security folk periodically), there is no security difference between DPAPI and WinCredsManager .

from microsoft-authentication-extensions-for-dotnet.

brphelps avatar brphelps commented on July 22, 2024

ACK on wincredmanager.

I think there's a pretty big exception to what you're saying above -- Headless linux (arguably more widely used than headed linux) seems to still fallback to a plaintext password in that cred manager. Is there a way we can disable that behavior or cause it to throw instead of just warn?

Thanks!

from microsoft-authentication-extensions-for-dotnet.

jmprieur avatar jmprieur commented on July 22, 2024

@bgavrilMS : isn't this more a question for the extension library?

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

@brphelps - MSAL on its own will not store tokens anywhere for .NET Fx and .NET Core runtimes. You have to customize storage. We offer a solution for this here: https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/ which seems to satisfy your needs, including Linux fallback.

from microsoft-authentication-extensions-for-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.