Git Product home page Git Product logo

Comments (2)

BrotherBrine avatar BrotherBrine commented on June 11, 2024 1

I'm getting the same error as @AndersBillLinden on the Clone request. using LibGit2Sharp v0.28.0 and LibGit2Sharp.NativeBinaries v2.0.320

from libgit2sharp.

old-guy-coder avatar old-guy-coder commented on June 11, 2024

I am seeing the same error on LibGit2Sharp v0.30.0, any update on this?

Update

I have the following code and have tried with CustomHeader and the UsernamePasswordCredentials set for the CredentialsProvider and get a 400 response back from Clone. The following code uses just the CustomHeader and gets the same 400 response.

sourceUrl is https://{orgName}@dev.azure.com/{orgName}/{projectName}/_git/{repoName}

var repoPath = LibGit2Sharp.Repository.Clone(
    sourceUrl,
    workingDirectoryPath,
    new CloneOptions
    {
        Checkout = true,
        FetchOptions =
        {
            Prune = true,
            CustomHeaders = new[]
            {
                "Authorization: Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(
                    string.Format(CultureInfo.CurrentCulture, "{0}:{1}", "", _azureDevOpsOptions.PatToken)))
            }
        }
    });

Using just the CredentialProvider I get the error that the OP reported, have a brand new PAT token so I know that's not the issue! So I have some questions because this was working a few months back:

  1. Should the PAT token be base64 encoded in the CredentialProvider?
  2. Does 2FA have any impact on this? Would that be the reason for the original error?

from libgit2sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.