René's URL Explorer Experiment


Title: Impossible to push to Azure repository using Person Access Token · Issue #2041 · libgit2/libgit2sharp · GitHub

Open Graph Title: Impossible to push to Azure repository using Person Access Token · Issue #2041 · libgit2/libgit2sharp

X Title: Impossible to push to Azure repository using Person Access Token · Issue #2041 · libgit2/libgit2sharp

Description: My problem is described perfectly here, but I don't think the solution is the correct one, since that would use the credentials stored on the computer as far as I'm aware. When making git requests to an azure repository with a PAT, it is...

Open Graph Description: My problem is described perfectly here, but I don't think the solution is the correct one, since that would use the credentials stored on the computer as far as I'm aware. When making git requests ...

X Description: My problem is described perfectly here, but I don't think the solution is the correct one, since that would use the credentials stored on the computer as far as I'm aware. When making git r...

Opengraph URL: https://github.com/libgit2/libgit2sharp/issues/2041

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Impossible to push to Azure repository using Person Access Token","articleBody":"My problem is described perfectly [here](https://stackoverflow.com/questions/71126033/libgit2sharp-how-to-push-a-local-repo-commit-to-azure-devops-remote-repo-using), but I don't think the solution is the correct one, since that would use the credentials stored on the computer as far as I'm aware.\r\n\r\nWhen making git requests to an azure repository with a PAT, it is expected to be passed along as a custom header. (see [documentation](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\u0026tabs=Windows#use-a-pat)).\r\n\r\nThis is possible when doing a Clone operation, since CloneOptions contains FetchOptions, which allows us to set custom headers.\r\n\r\nSo a clone is perfectly possible as follows:\r\n```cs\r\nstring encodedToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($\":{credentials.PersonalAccessToken}\"));\r\nvar fetchOptions = new FetchOptions\r\n{\r\n    CustomHeaders = new[] {\r\n        $\"Authorization: Basic {encodedToken}\"\r\n    }\r\n};\r\nvar options = new CloneOptions\r\n{\r\n    CredentialsProvider = (url, usernameFromUrl, types) =\u003e\r\n                    new UsernamePasswordCredentials()\r\n                    {\r\n                        Username = credentials.UserName,\r\n                        Password = credentials.PersonalAccessToken\r\n                    },\r\n    FetchOptions = fetchOptions,\r\n    BranchName = branchName,\r\n    Checkout = true,\r\n    OnCheckoutProgress = (path, completedSteps, totalSteps) =\u003e\r\n        Logger.LogInformation(\"Clone progress {completed} / {total}\", completedSteps, totalSteps),\r\n    RepositoryOperationCompleted = (context) =\u003e\r\n        Logger.LogInformation(\"Clone completed\"),\r\n};\r\n\r\nRepository.Clone(Remote, WorkingDirectory, options);\r\n```\r\n\r\nHowever, when trying to push to this same repository, PushOptions does not expose something similar to include the PAT as header, even though it is stored in the internal data structure since https://github.com/libgit2/libgit2sharp/pull/1233 .\r\n\r\nUsing the provided example from the [wiki](https://github.com/libgit2/libgit2sharp/wiki/git-push)\r\nI get the following error:\r\n`Unhandled exception: too many redirects or authentication replays | LibGit2Sharp.LibGit2SharpException | too many redirects or authentication replays`\r\nWhich is the exact same error I was getting when trying to clone without the added custom header.\r\n\r\nAs far as I can see, there is a PR open that would fix this, but it is not yet merged in: https://github.com/libgit2/libgit2sharp/pull/2011\r\n\r\n","author":{"url":"https://github.com/TackyTortoise","@type":"Person","name":"TackyTortoise"},"datePublished":"2023-06-06T14:52:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2041/libgit2sharp/issues/2041"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d8c235a5-36d3-597a-c145-10d3ae86addc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE3EA:13AA49:639820A:80E7E0E:697E195B
html-safe-nonce1b56d08c6740fc43454a4841c3993b680b0a7d6cb54a8f3da51686efa5e5373e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0VBOjEzQUE0OTo2Mzk4MjBBOjgwRTdFMEU6Njk3RTE5NUIiLCJ2aXNpdG9yX2lkIjoiODE0NTc1MjkxNDQ2NzI5MDUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf3a04e1f9bef720ac220bcfece0d82b36c8c944c4b101d02019117a4e874eba6
hovercard-subject-tagissue:1744040626
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/libgit2/libgit2sharp/2041/issue_layout
twitter:imagehttps://opengraph.githubassets.com/72f7032631c8a8ae811e53641eef684a0b9177146d66c678317a9ecc5e1db446/libgit2/libgit2sharp/issues/2041
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/72f7032631c8a8ae811e53641eef684a0b9177146d66c678317a9ecc5e1db446/libgit2/libgit2sharp/issues/2041
og:image:altMy problem is described perfectly here, but I don't think the solution is the correct one, since that would use the credentials stored on the computer as far as I'm aware. When making git requests ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameTackyTortoise
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
go-importgithub.com/libgit2/libgit2sharp git https://github.com/libgit2/libgit2sharp.git
octolytics-dimension-user_id394745
octolytics-dimension-user_loginlibgit2
octolytics-dimension-repository_id1415168
octolytics-dimension-repository_nwolibgit2/libgit2sharp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1415168
octolytics-dimension-repository_network_root_nwolibgit2/libgit2sharp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues/2041#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Flibgit2%2Flibgit2sharp%2Fissues%2F2041
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Flibgit2%2Flibgit2sharp%2Fissues%2F2041
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=libgit2%2Flibgit2sharp
Reloadhttps://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues/2041
Reloadhttps://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues/2041
Reloadhttps://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues/2041
libgit2 https://patch-diff.githubusercontent.com/libgit2
libgit2sharphttps://patch-diff.githubusercontent.com/libgit2/libgit2sharp
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Flibgit2%2Flibgit2sharp
Fork 921 https://patch-diff.githubusercontent.com/login?return_to=%2Flibgit2%2Flibgit2sharp
Star 3.4k https://patch-diff.githubusercontent.com/login?return_to=%2Flibgit2%2Flibgit2sharp
Code https://patch-diff.githubusercontent.com/libgit2/libgit2sharp
Issues 396 https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues
Pull requests 51 https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/pulls
Actions https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/actions
Projects 0 https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/projects
Wiki https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/wiki
Security 0 https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/security
Insights https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/pulse
Code https://patch-diff.githubusercontent.com/libgit2/libgit2sharp
Issues https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues
Pull requests https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/pulls
Actions https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/actions
Projects https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/projects
Wiki https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/wiki
Security https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/security
Insights https://patch-diff.githubusercontent.com/libgit2/libgit2sharp/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/libgit2/libgit2sharp/issues/2041
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/libgit2/libgit2sharp/issues/2041
Impossible to push to Azure repository using Person Access Tokenhttps://patch-diff.githubusercontent.com/libgit2/libgit2sharp/issues/2041#top
https://github.com/TackyTortoise
https://github.com/TackyTortoise
TackyTortoisehttps://github.com/TackyTortoise
on Jun 6, 2023https://github.com/libgit2/libgit2sharp/issues/2041#issue-1744040626
herehttps://stackoverflow.com/questions/71126033/libgit2sharp-how-to-push-a-local-repo-commit-to-azure-devops-remote-repo-using
documentationhttps://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows#use-a-pat
#1233https://github.com/libgit2/libgit2sharp/pull/1233
wikihttps://github.com/libgit2/libgit2sharp/wiki/git-push
#2011https://github.com/libgit2/libgit2sharp/pull/2011
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.