locked
GitLib2Sharp Repository.Clone error "Too many redirects or authentication replays" RRS feed

  • Question

  • Hi, I'm creating a server-side plugin for TFS for git by using the LibGit2Sharp library.

    I'm having problems with cloning a repository from my TFS-server which I run locally. This server is authenticated with NTLM.

    This is my code:

    var co = new CloneOptions();
          co.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials { Username="admin", Password="pass"};
          LibGit2Sharp.Repository.Clone(_repoPath, _clonePath, co);
    When using this code, I get the error "Too many redirects or authentication replays". I also tried to used the DefaultCredentials, but had no luck. Does anyone know the solution for this problem?



    • Edited by DStekel Wednesday, October 26, 2016 2:12 PM
    • Moved by CoolDadTx Wednesday, October 26, 2016 2:37 PM TFS related
    Wednesday, October 26, 2016 2:11 PM

All replies

  • Hi DStekel,

    Thank you for posting here.

    According to the test in my machine. I got the same error when I used:

    co.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials { Username="admin", Password="pass"};

    But when I used DefaultCredentials, I could clone the repository successfully:

    co.CredentialsProvider = (_url, _user, _cred) => new DefaultCredentials();

    Please try to change the Authentication Settings in TFS console, then check the result again.And LibGit2Sharp supports NTLM and Kerberos with default credentials out of the box.  At the moment, it does not support specified credentials with NTLM. 

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.




    Friday, October 28, 2016 7:11 AM
    Moderator
  • use a URL that looks like this 

    git@bitbucket.org:username/sample.git

    instead of https://bitbucket.org/username.sample.git


    • Edited by OmkarDusane Thursday, November 9, 2017 9:23 AM
    Thursday, November 9, 2017 9:23 AM