-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Version
2.4.1
Operating system
Linux
OS version or distribution
Ubuntu 22.04
Git hosting provider(s)
Azure DevOps
Other hosting provider
No response
(Azure DevOps only) What format is your remote URL?
https://{org}@dev.azure.com/{org}
Can you access the remote repository directly in the browser?
Yes, I can access the repository
Expected behavior
We are trying to access our ADO repo from inside a linux docker container using GCM and the ephemeral git credential store and the devicecode login flow. The basic idea is we use cross-platform, cross-architecture docker dev environments and we would like to be able to get our code using oauth2 (ideally) or pat (less ideal, but ok) rather than using an imported ssh key.
We basically install dotnet 7 sdk and then use that to install gcm via the Dockerfile. We then have the .gitconfig set up as follows:
[credential]
helper =
helper = /home/devuser/.dotnet/tools/git-credential-manager
credentialStore = cache
cacheOptions = --timeout 36000
msauthFlow = devicecode
azreposCredentialType = oauth
[credential "https://dev.azure.com"]
useHttpPath = true
Our expectation is that this would work, i.e., that when the user then clones the repo from the cli in the container they would get a device code that they can input in their browser to do a normal oauth flow login.
Actual behavior
It almost works, but we get this:
Cloning into 'some-repo'...
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 [REDACTED] to authenticate.
The behavior is the same if we use pat instead of oauth
If we go forward, it "works", but obviously we are worried that the token is being persisted insecurely.
Logs
No response