-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add caching to DeviceCodeCredential #11043
Comments
Thanks for opening this issue. |
The PR says caching is only supported on Windows. That makes it kind of useless for me and I'm sure many others. Can Linux/macOS be added as well? |
Persistent caching to disk is only supported on Windows today but with that pull request the credentials will fall back to an in memory cache on other platforms, which is what I believe you're asking for. I'm sorry the PR isn't explicit on that point. |
Persistent caching would be ideal and is what I'm really looking for. The Azure ML folks monkey-patch and piggy-back on the Azure CLI package to get persistence, but obviously that's not great and I can't do the same. Would it be possible to add Linux support to this PR? As far as I see, it would just be a matter of picking another caching folder, like ~/.azure-identity-service/msal-cache. |
We've been waiting until we can encrypt the cache on Linux. AzureAD/microsoft-authentication-extensions-for-python#44 has initial support for that, with the limitation that it requires libsecret and so probably doesn't work in your SSH session. When we do support persistence on Linux, the cache will be encrypted by default with an explicit opt out. API changes to enable that will come in a future PR. |
OK sounds good. For the record, I'm fine with storing the tokens in an unencrypted file as fall-back. |
In azure-identity 1.4.0b3, released today, Today's release also includes optional caching to disk on Windows when the credential is constructed with |
I can't use the interactive browser credential (which does cache) as I'm connected to a VM via SSH. Since the device code flow serves the same purpose it should also support caching.
The text was updated successfully, but these errors were encountered: