Skip to content

GitLab: Ignore username from Git credential input when looking up and generating credentials #2270

@tjuchniewicz

Description

@tjuchniewicz

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:

  1. 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:

  1. User runs git pull
  2. GCM checks for token for user test - token is missing (not in cache, that's OK)
  3. GCM asks user to login using browser
  4. GCM Stores token in cache with user oauth (not test)
  5. git pull is successful
  6. User runs git pull again
  7. GCM checks for token for user test - token is not found due to invalid user!
  8. GCM asks user again to login using browser

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    auth-issueAn issue authenticating to a hosthost:gitlabSpecific to the GitLab host provider

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions