Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibGit2Sharp.LibGit2SharpException: failed to parse supported auth schemes: The operation identifier is not valid #2048

Open
Rpatil3g opened this issue Jul 7, 2023 · 6 comments

Comments

@Rpatil3g
Copy link

Rpatil3g commented Jul 7, 2023

// code start
LibGit2Sharp.PullOptions options = new LibGit2Sharp.PullOptions();
options.FetchOptions = new FetchOptions();
options.FetchOptions.CredentialsProvider = new CredentialsHandler(
(url, usernameFromUrl, types) =>
new UsernamePasswordCredentials()
{
Username = _gitCredsUser,
Password = _gitCredsPassword
});

        // User information to create a merge commit
        var signature = new LibGit2Sharp.Signature(
            new Identity(_gitUsername, _gitEmail), DateTimeOffset.Now);

        // Pull
        Commands.Pull(repo, signature, options);

// end code

I am using LibGit2Sharp dll of 0.26.0.0, from last few days I am getting "failed to parse supported auth scheme" error while doing git pull. My git repository is on GITHUB. I am sure there might security related changes done on github side. that's why this error come.

Reproduction steps

Expected behavior

git pull should work without error.

Actual behavior

Version of LibGit2Sharp (release number or SHA1)

0.26.2

Operating system(s) tested; .NET runtime tested

windows 10

@GeorgeTTD
Copy link

@Rpatil3g did you mange to get around this issue? I think its definitely a breaking change in GitHub as had similar issues with GitKraken too with the same error message.

@Kh-Ghassen
Copy link

Kh-Ghassen commented Aug 31, 2023

@Rpatil3g @GeorgeTTD did anyone of you manage to get around this issue ? i'm having the same with LibGit2Sharp 0.27.2
Her is exactly when it occurs :

System.IO.Directory.CreateDirectory(dirPath); var cloneOptions = new LibGit2Sharp.CloneOptions { CredentialsProvider = (_url, _user, _cred) => new LibGit2Sharp.UsernamePasswordCredentials { Username = AccessToken, Password = string.Empty }, BranchName = Branch, }; LibGit2Sharp.Repository.Clone(cloneUrl, dirPath, cloneOptions);

@GeorgeTTD
Copy link

@Kh-Ghassen there is apparently a workaround but its a bit low level for us as we don't have the C skills to diagnose the issue. so we have chosen to remove the dependency from our source.

@Kh-Ghassen
Copy link

Thanks @GeorgeTTD , can i ask you what did you choose for replacement ?

@GeorgeTTD
Copy link

@Kh-Ghassen our use case is very limited so may not work for yours but we have gone with calling command line git inspired by this repo: https://github.com/WonkySpecs/GitWrapper/blob/master/Git.cs

As a side note we also use GitKraken that use libgit2 and I was having the same issue with their product. When I spoke to their support they said they are removing libgit2 and using command line git instead, I assume in a similar way.

@Kh-Ghassen
Copy link

@GeorgeTTD Cool , thank you very much , i think we'll try to go with command line also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants