How can we commit changes using the access token key that gets generated using oauth support in gitHub
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- csharp, git, github
- Ambito
- authentication
Direzione di ricerca
Inizia con la configurazione delle credenziali di CloneOptions e PushOptions nell’issue, usando LibGit2Sharp 0.26.2 su .NET 5.0. Riproduci il 403 durante la chiamata a Network.Push e controlla il remote, il refspec e le credenziali coinvolte. Il lavoro è completato quando la modifica in staging può essere sottoposta a commit e inviata al repository GitHub con il token OAuth.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
How can we commit changes to github using the access token generated using github Oauth.
I have got the access token and able to clone the repository using the code below
CloneOptions options = new CloneOptions();
var creds = new UsernamePasswordCredentials()
{
Username = "access token"
Password = string.Empty
};
CredentialsHandler credHandler = (_url, _user, _cred) => creds;
options.CredentialsProvider = credHandler;
string clonedRepoPath = Repository.Clone("repository", repoLocation, options);
repo = new Repository(repoLocation);
But unbale to commit the changes using the access token. below code fails with the error "'request failed with status code: 403"
Commands.Stage(repo, "abc.txt");
Signature sig = new Signature(new Identity("name", "email"), DateTimeOffset.Now);
Commit commit = repo.Commit("", sig, sig);
// Push to remote repository
var creds = new UsernamePasswordCredentials()
{
Username = "access token",
Password = ""
};
CredentialsHandler credHandler = (_url, _user, _cred) => creds;
var fetchOpts = new PushOptions { CredentialsProvider = credHandler };
repo.Network.Push(repo.Network.Remotes["origin"], "HEAD", @"refs/heads/master", fetchOpts);
Expected: Should be able to commit changes using access token.
Version of LibGit2Sharp (release number or SHA1)
LibGit2Sharp.0.26.2
Operating system(s) tested; .NET runtime tested
OSx, .net core 5.0
- Lingua principale
- C#
- Stelle
- 3.5k
- Fork
- 925
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di libgit2/libgit2sharp
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
libgit2/libgit2sharp#2193 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
libgit2/libgit2sharp#2192 · 1 commento ·
-
Website is down Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
libgit2/libgit2sharp#2191 · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
libgit2/libgit2sharp#2189 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
libgit2/libgit2sharp#2187 · 2 commenti ·
Tutte le issue di libgit2/libgit2sharp
Issue simili
-
type/automation type/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
t/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
area:auth FE mvp P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
klasolsson81/jobbliggaren#1788 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OrchardCMS/OrchardCore#19919 · 2 commenti ·
-
app-frontend: parked task URL throws 'Unknown task type' once the process moves on to a signing task Apertaarea/process kind/bug squad/flyt squad/utforming
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Altinn/altinn-studio#20570 ·