libgit2 / libgit2/libgit2sharp

LibGit2Sharp.LibGit2SharpException | too many redirects or authentication replays

Open
#2,117 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

I am using LibGit2Sharp (version 0.28.0) with a Personal Access Token to access AZURE Repository.

UsernamePasswordCredentials =>
{
Username = "pat",
Password = PersonalAccessToken
}

CustomHeader => "Authorization: Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes($":{PersonalAccessToken}"))}"

Everything was working as expected until last week, when I started encountering exceptions while trying to interact with the remote repository (e.g., clone, pull, push).

Clone failed. | LibGit2Sharp.LibGit2SharpException | too many redirects or authentication replays
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /
/LibGit2Sharp/Core/Ensure.cs:line 154
at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in //LibGit2Sharp/Core/Ensure.cs:line 172
at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) in /
/LibGit2Sharp/Core/Proxy.cs:line 278
at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) in //LibGit2Sharp/Repository.cs:line 824

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported call path in Core/Ensure.cs, Core/Proxy.cs, and Repository.cs, focusing on Repository.Clone in LibGit2Sharp 0.28.0. Reproduce the authentication failure against an Azure repository using the shown credentials and headers, then document the cause and verify that clone, pull, and push no longer produce the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, git
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.