Repository navigation
Provide automatic git authentication to GitHub - #96069
Merged
Merged
Conversation
Contributor
I was always hoping that eventually the GHPR extension would be simply "GitHub", especially now since it has issues in it as well. |
Contributor
Author
|
Rachel Macfarlane (@RMacfarlane) had a great idea to tackle the dialog without any big decisions: we can make it such that the Git extension requests access to the creds, making it read:
Which I really like. 👍 |
Contributor
Author
|
Alright, ended up moving the code into the Git extension for now, which means the dialog will look nice. |
3 tasks done
This was referenced Apr 27, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #96241
The Git extension currently already hijacks into the
GIT_ASKPASSmechanism to provide UI to prompt the user for credentials when they try to run git commands over an HTTPS-based remote and do not have any credential manager installed:This PR adds a new
registerCredentialsProvidermethod to the Git extension API which allows other extensions to contribute to that mechanism and provide credentials themselves, before the last resort of prompting the user is used. Using the newvscode.authenticationAPI, an extension can easily provide GitHub access tokens as credentials. We would have automatic authentication for allGit: Pull,Git: Push, etc. commands in our UI for GitHub repositories!We could implement this in the GHPR extension, but another option is to simply implement this in the
github-authenticationcore extension. Why not have this built into the core?This PR implements exactly that.
The authentication authorization dialog currently looks like this:
It feels strange that
GitHub Authenticationappears in there.GitHub?github, for that matter?Also, while this tackles git commands in the UI, it doesn't address terminal commands yet. Once #96061 lands, we'll be able to simply add a
GIT_ASKPASSenv var to terminals and evengit pull,git push, etc. commands in the integrated terminal would have GitHub automatic authentication working.cc Erich Gamma (@egamma) Kai Maetzel (@kieferrm) Rachel Macfarlane (@RMacfarlane) Daniel Imms (@Tyriar) Chris Dias (@chrisdias)