-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
New "info: detecting host provider for 'https://example.com'..." message after upgrading to git version 2.33.1.windows.1 #492
Comments
I have the same issue with git 2.25.1 on WSL and 2.33.1 on windows. The "detecting" message could be silent. Is it really an error?:https://github.com/microsoft/Git-Credential-Manager-Core/blob/1f926e42c40db15e3fab0c68a7a5c3aabd416ce7/src/shared/Microsoft.Git.CredentialManager/HostProviderRegistry.cs#L176 |
In order to provide the best authentication experience, GCM needs to know what sort of Git hosting provider you're using. For example, is this GitHub.com, Azure DevOps, a GitHub Enterprise Server or Bitbucket Server instance? For the "cloud" providers like GitHub.com or Azure DevOps we can simply look at the remote URL to see "github.com" or "dev.azure.com" and route to their preferred (or even required) authentication protocols (for example OAuth2, or OpenID Connect). However, for the self-hosted ("on-prem") versions we don't know! The remote URL isn't any use to us since this can be named anything or even a local IP address. Also due to the limitation in the design, Git doesn't surface any HTTP response headers to us, only the host name! GCM first checks all the supported host providers by matching the host name to the known cloud name:
If we reach this point, we then perform a HTTP
If we get all the way to this point, we don't know anything about the host provider and so fall to a "generic" solution.
The
When setting the provider option GCM does not do any of the above logic to determine the provider; you have told us to go directly to the "generic" or "bitbucket" provider.
I agree! The problem is trying to strike the right balance. Git doesn't tell the credential helpers nearly enough information to be able to "know" what sort of authentication protocol to use beyond "I need a password for example.com". In an ideal world, Git would provide helpers like GCM with the HTTP authentication challenge (the If we didn't perform any of the auto-detection logic, then many people using on-prem servers like GitHub Enterprise Server or Bitbucket Server would need to configure GCM (with the @lnu:
Writing optional/informational messages to the Standard Error stream is a common practice in the Git ecosystem. The Standard Output stream is often parsed for information, which we don't want to break. In credential helper case, the stdout stream is being used to communicate back to the Git process. Given extra noise it generates (for not much value), I think we can consider removing the |
Remove the "info: detecting host provider for 'URL'..." message that is only causing noise for users. Fixes git-ecosystem#492
Looking at the Bitbucket provider, seems like it says that only password-based authentication is available for Bitbucket DC (there is no OAuth support). @mminns is this true? Does DC not also support OAuth?
I know that the GitHub provider shows the URL when connecting to a GHES instance. This is something the Bitbucket UI should probably also surface.
This sounds like a bug. We should either hide those links, or direct to the relevant documentation for DC/the correct forgot password link. |
No, Bitbucket DC does not currently support OAuth 2. |
I thought it looked familiar :) I did look at adding OAuth 1 support, included in Bitbucket DC, to GCMW this included showing the host mminns/Git-Credential-Manager-for-Windows@854fde0#diff-7b2d00fce1e8c79e3e929f1921bf8f2f78cb3d4fab0e586fa5889f718fcea3fe It worked but the OAuth1 configuration was too painful to be practical. |
While I'm at it, I have yet another question: why do we pay this auto-detection tax every time we |
FWIW OAuth2 is coming to Bitbucket DC, I believe by the end of this year. I have a PoC branch of GCMC that implements OAuth2 support for DC https://github.com/mminns/Git-Credential-Manager-Core/tree/SHPLII-74. |
@mjcheetham Does it make sense that I open another issue for the question above?
Thanks |
I know this issue is closed but I'm unsure where else to put this... The auto-detection strategy here is really anoying when used with git servers that are not auto-detected. |
This problem is even worse when you are behind a proxy:
@mjcheetham We use Azure Devops Server (On Premise) exclusively. The documentation mentions that it can be configured in a way to avoid auto-detection completely. Could you give a concrete example how we would do this for the "On Premise" variant? EDIT:
|
Remove the "info: detecting host provider for 'URL'..." message that is only causing noise for users. Fixes git-ecosystem#492
Remove the "info: detecting host provider for 'URL'..." message that is only causing noise for users. Fixes git-ecosystem#492
Hello,
After upgrading to Git For Windows version
2.33.1
, we started seeing new messages onstderr
as well as slow downs.Even though I landed on https://github.com/microsoft/Git-Credential-Manager-Core/blob/main/docs/autodetect.md, I still don't understand what this auto-detection of host provider is for.
Can you please elaborate on why the core credential manager needs to be aware of the application running on the remote server? What's the link with the Git protocol and authentication?
We also noticed the portable version of Git which uses
git-credential-wincred.exe
doesn't exhibit this behavior while working perfectly.Using
or
doesn't seem to end up with other observable side effect than the suppression of the messages.
Finally note that our remote repositories are handled by an on premise Bitbucket Server instance which is behind a reverse proxy. A
HEAD
request exhibits theX-AREQUESTID
header you're looking for:My understanding is that
providers.TryGetFirst(x => x.IsSupported(probeResponse), out match)
calls intoBitbucketHostProvider.IsSupported()
after other providers.All in all, it seems too bad this auto detection is needed at all and done in sequence.
Thanks.
The text was updated successfully, but these errors were encountered: