git-ecosystem / git-ecosystem/git-credential-manager
GitLab: Ignore username from Git credential input when looking up and generating credentials
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.3k
- Forks
- 2.9k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 14
Description
Version
2.7.0.0
Operating system
Windows
OS version or distribution
Windows 11
Git hosting provider(s)
GitLab
Other hosting provider
No response
(Azure DevOps only) What format is your remote URL?
None
Can you access the remote repository directly in the browser?
Yes, I can access the repository
Expected behavior
Expected Behavior
The GitLab provider should:
- Completely ignore the username from Git's credential input with OAuth
Rationale
- Using the input username can cause incorrect credential lookups and confusing authentication prompts
Actual behavior
Current Behavior
When Git passes a username in the credential request (e.g., username=test when remote.origin.url=https://test@repo.git), the GitLab provider:
- User runs
git pull - GCM checks for token for user
test- token is missing (not in cache, that's OK) - GCM asks user to login using browser
- GCM Stores token in cache with user
oauth(nottest) git pullis successful- User runs
git pullagain - GCM checks for token for user
test- token is not found due to invalid user! - GCM asks user again to login using browser
Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the GitLab provider's credential lookup and OAuth credential-generation entry points, then reproduce the issue's two consecutive git pull requests with a supplied username. The work is done when the username is ignored for lookup and generation, so the OAuth token is stored and reused without another browser login.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- authentication, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100