libgit2 / libgit2/libgit2sharp

Getting exception "too many redirects or authentication replays"

Đang mở
#2,069 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C#
Star
3.5k
Fork
925
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am trying to pull from a github repository with the following code getting an exception "too many redirects or authentication replays". Why? If I failed to login, I expect an exception telling me that. Also the exception suggests that it retried whatever it did a couple of times although "replay" needs clarification. Where do I configure the number of retries if any? I have no interest in trying more than once. I have checked the credentials many times and also I tried to pull from an azure devops repo with the same result.

public void dothepulling()
{
  string repoPath = "C:\\project\\test.git";

  using (var repo = new Repository(repoPath))
  {

    var FetchOptions = new FetchOptions
    {
      CredentialsProvider = func
    };

    var pullOptions = new PullOptions
    {
      MergeOptions = new MergeOptions
      {
        FastForwardStrategy = FastForwardStrategy.FastForwardOnly,
        FileConflictStrategy = CheckoutFileConflictStrategy.Theirs,
        IgnoreWhitespaceChange = false
      },
      FetchOptions = FetchOptions
    };

    var signature = new Signature(new Identity("Firstname Lastname", 
      "my.email.@address.com"), DateTimeOffset.Now);

    Commands.Pull(repo, signature, pullOptions);
  }
}

private UsernamePasswordCredentials func(string url, string user,
  SupportedCredentialTypes types)
{
  return new UsernamePasswordCredentials
  {
    Username = "username",
    Password = "password"
  };
}

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với lệnh gọi Commands.Pull được cung cấp, PullOptions.FetchOptions của nó và callback CredentialsProvider; tái hiện ngoại lệ với GitHub hoặc Azure DevOps bằng đoạn mã đã cho. Theo dõi hành vi xác thực hoặc replay phát sinh và xác định xem thông báo, cấu hình retry hoặc cách xử lý đăng nhập thất bại có cần được làm rõ hay không, sau đó xác minh hành vi mong đợi bằng một bài kiểm thử tập trung nếu tìm thấy vị trí kiểm thử liên quan.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, git
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.