Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

git credential-manager store serializes username into url #888

Open
Rast1234 opened this issue Feb 19, 2020 · 0 comments
Open

git credential-manager store serializes username into url #888

Rast1234 opened this issue Feb 19, 2020 · 0 comments

Comments

@Rast1234
Copy link

Rast1234 commented Feb 19, 2020

I am trying to integrate Source Link into our development process. Our repositories are hosted in a way that public access is denied. The only way to make Visual Studio include some credentials into GET request is by using option Fall back to Git Credential Manager authentication for all Source Link requests. It works fine. If credentials exist for given hostname, GCM provides them. If not, GCM prompts for user-pass prompt and stores them for later use in Windows Credential Manager.

Now i want to simplify and automate set up process for developers. Instead of manually going into Windows Credential Manager i thought it would be possible to do something like this:

git credential-manager store < credentials.txt

where credentials.txt is:

protocol=https
host=HOST
username=USER
password=ACCESS_TOKEN

This gets stored in Windows Credential Manager like this:

Address: git:https://USER@HOST
Username: USER
Password: ACCESS_TOKEN

Visual Studio does not recognize this! It does work if Address part is git:https://HOST, but git credential-manager store appends USER@ and i can not find a way around this behavior.

Simple way to reproduce this:

  1. create file store.txt:
protocol=https
host=HOST
username=USER
password=ACCESS_TOKEN
  1. create file get.txt:
protocol=https
host=HOST
  1. write credentials: git credential-manager store < store.txt
  2. this should work but prompts for credentials instead: git credential-manager get < get.txt

Expected behavior:

  1. Windows Credential Manager entry has address without USER@ part
  2. store and get work for given protocol+host

My version info:

$ git --version
git version 2.21.0.windows.1

$ git credential-manager version
Git Credential Manager for Windows version 1.18.4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant