0

i am using Bonobo.Git.Server as my Git Repo Server.

how can i pass in credientials to clone a repo? Below is the c# code i use. but i keep getting this error,

ERROR_An error was raised by libgit2. Category = Invalid (Error). Failed to parse supported auth schemes: The operation identifier is not valid.

Credentials cred = new Credentials();

cred.Username = "pspl\admin";
cred.Password = "admin";

Repository.Clone("http://localhost:50287/Repo1.git", @"C:\Users\gohks\Desktop\testFolder", false, true, null, null, cred);

BTW can possible to send current logon windows crediential?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
KS Kian Seng
  • 319
  • 1
  • 6
  • 14

1 Answers1

0

It looks like you're relying on Windows authentication to communicate with Bonobo.

LibGit2Sharp doesn't support this by default. However you may find some help on the work done by @GasparNagy on this post to support NTLM authentication.

Supporting source code can be found here.

Community
  • 1
  • 1
nulltoken
  • 64,429
  • 20
  • 138
  • 130
  • I not using windows authentication, thou username looks like one. – KS Kian Seng Feb 04 '14 at 07:20
  • i manage to get it worked. i cannot supply domain in the username field. – KS Kian Seng Feb 04 '14 at 07:27
  • *"i cannot supply domain in the username field"* -> I'm not sure to understand this statement. Can you please elaborate? – nulltoken Feb 04 '14 at 08:31
  • 1
    *"i manage to get it worked."* -> Awesome! Maybe could you add an answer to this question describing what changes you've done in order to successfully communicate with Bonobo Git Server? That may help later other users with a similar issue. – nulltoken Feb 04 '14 at 08:32
  • in my code, Username = 'pspl\admin' but there is an error. after i change the Username = 'admin' the authentication pass thru. and clone was successful. – KS Kian Seng Feb 04 '14 at 09:16
  • I read @GasparNagy post, and i download his project. but i keep missing Microsoft.TeamFoundation.Git.CoreServices reference. Tired to install TFS express. But still cannot find reference. where can i get this library? – KS Kian Seng Feb 04 '14 at 09:17
  • @KSKianSeng I think this may be a good fit for a new StackOverflow question. – nulltoken Feb 04 '14 at 18:54
  • I strongly recommend using the NtlmGitSession / HttpClientSmartSubtransport implementation from my sample. That does not depend on the VS assembly (just on the patched native git dll). – Gaspar Nagy Feb 05 '14 at 08:41