Skip to content
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

Support plain text file cache fallback in headless linux #410

Open
kyle-rader-msft opened this issue Sep 19, 2024 · 11 comments
Open

Support plain text file cache fallback in headless linux #410

kyle-rader-msft opened this issue Sep 19, 2024 · 11 comments

Comments

@kyle-rader-msft
Copy link
Contributor

I've been using azureauth in Wave Workspaces (a C+AI alternative to microsoft devbox) where you connect via VSCode to a Linux VM. Azureatuh can be installed here, and ... through VSCode, it actually can already launch a web browser auth prompt! Which is great!

The problem is that you get the cache persistence check failures, because it's headless. And there is no cache. Meanwhile, the git credential manager in the same environment, is not launching a web prompt and forces me to do device code login - but it caches in a plain text file, so it doesn't prompt after that.

It would be great to have azureauth also allow a plain text fallback in this scenario.

@mvanchaa
Copy link
Contributor

But @kyle-rader-msft wouldn't that be a security issue as it's a plain text?

@kyle-rader-msft
Copy link
Contributor Author

kyle-rader-msft commented Sep 25, 2024 via email

@rewrlution
Copy link

Hey @kyle-rader-msft , I am Huijing.

It would be great to have azureauth also allow a plain text fallback in this scenario.

Am I reading your feature request correctly that you want us to persist access token in plain-text file just like what Git Credential Manager does?

@kyle-rader-msft
Copy link
Contributor Author

kyle-rader-msft commented Sep 25, 2024 via email

@AtOMiCNebula
Copy link

Allowing an opt-in to plaintext credential caching is fine IMO, though I'm not confident enough in the space to want to suggest making it default behavior. Perhaps naming the setting something like "allow plaintext cache storage"? Ultimately, as long as the cache file itself is only user-readable (and not group/world-readable), then that seems pretty reasonable to me.

@kyle-rader-msft
Copy link
Contributor Author

kyle-rader-msft commented Nov 19, 2024

To add some more weight to this request: This is the current GCM experience we have in Wave Workspaces:

kyrader in 🌐 TDC*** in /workspace/*** 
❯ git clone https://******.visualstudio.com/*****/_git/******
Cloning into '******'...
warning: cannot persist Microsoft authentication token cache securely!
warning: using plain-text fallback token cache

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ****** to authenticate. 
😭😭😭😭😭😭

########################################
# => GO through full 2FA flow in browser, 
this is where azureauth, helpfully, will launch a normal web prompt out of the remote VS Code instance,
and if it was using the plain cache like GCM is here, it would all #just work...
########################################

remote: Azure Repos
remote: Found 383 objects to send. (62 ms)
Receiving objects: 100% (383/383), 204.83 KiB | 2.73 MiB/s, done.
Resolving deltas: 100% (131/131), done.

Using AzureAuth through a VSCode Remote dev experience on Linux, you actually get a native web browser on your host and can 1 click auth! But... the token caching doesn't work, so this happens everytime. If we enable plain text token cache on Linux, the auth experience for Wave Space and remote Linux dev through VS Code would be so much more awesome!

@dggsax
Copy link

dggsax commented Jan 29, 2025

Just wanted to comment that implementing this support would also help our usage of AzureAuth in Linux environments where we have customers wanting to build on top of our platform in Linux Environments.

@funArash
Copy link

My knowledge of the authentication is limited. however, would it be possible to integrate with Linux's keyring?
https://docs.keeper.io/en/privileged-access-manager/secrets-manager/integrations/linux-keyring#linux-keyring-utility

@kyle-rader-msft
Copy link
Contributor Author

kyle-rader-msft commented Jan 30, 2025 via email

@funArash
Copy link

I found this SOF post which talks about keyring (python) and secret-tools libsecret-tools package.. can any of these be used to store the creds?
I know cargo has support for libsecret.

Also, launching GUI in SSH session is a pain or not possible..
However, with WSL you can enable its GUI feature which allows to run X11 apps (Code, MS Edge, ..) on Linux.

In ${env:USERPROFILE}/.wslconfig add:

[wsl2]              
guiApplications=true

Not as convenient as using keyring, but it helps.

@kyle-rader-msft
Copy link
Contributor Author

kyle-rader-msft commented Jan 30, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants