-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Authentication on Bitbucket DC fails - Redirects to bitbucket.org #722
Comments
Morning @augustocarvalho Could you post up your It looks like you have set If its at all possible would you be able to post your Bitbucket DC URL or at least a close copy showing the structure of the URL? Thanks |
Hi @mminns, thanks for looking into it. When I first try to clone a repo from my Bitbucket server, it detects a bitbucket provider and configures my gitconfig: My Bitbucket DC URL is simple: https://git.mydomain.com $ git config --list |
I think the problem here is the It should probably be modified to take a |
Finally have a little time to look into this |
Ah I think it was this commit that broke it, prior to this the check for 2FA was ignored for Bitbucket Server/DC instances. 5a2cfd7#diff-2204d18f7d581ae182cb6a29ef9d7e6b3d850d32dffce2d889305eed1941cc64R124 I haven't yet worked out why I removed it. It would suggest releases < v2.0.567 should work correctly. |
See #743 |
BitbucketHostProvider: fix runtime exceptions when authentication requests for Bitbucket DC would incorrectly call a Bitbucket Cloud REST API A bug was introduced in commit: 5a2cfd7. Prior to this only authentication requests for Bitbucket Cloud would try and automatically determine if 2FA was required by the current user by calling a Bitbucket Cloud REST API using user provided Basic Auth credentials Commit: 5a2cfd7 removed checking of the current host was Bitbucket Cloud vs DC. This meant the check would be run for Bitbucket Cloud and DC regardless. It would fail for Bitbucket DC The fix is more radical than simply re-instating the check on the type of Bitbucket host.From 1st March 2022 support for using a Bitbucket Cloud user's account password to access REST or Git HTTPS operations has been removed, https://atlassian.community/t5/x/x/ba-p/1948231. As such this automatic test to see if 2FA is required no longer works. Therefore the check against the Bitbcuket Cloud REST API has been removed in its entirety
BitbucketHostProvider: fix runtime exceptions when authentication requests for Bitbucket DC would incorrectly call a Bitbucket Cloud REST API A bug was introduced in commit: 5a2cfd7. Prior to this only authentication requests for Bitbucket Cloud would try and automatically determine if 2FA was required by the current user by calling a Bitbucket Cloud REST API using user provided Basic Auth credentials Commit: 5a2cfd7 removed checking of the current host was Bitbucket Cloud vs DC. This meant the check would be run for Bitbucket Cloud and DC regardless. It would fail for Bitbucket DC The fix is more radical than simply re-instating the check on the type of Bitbucket host. From 1st March 2022 support for using a Bitbucket Cloud user's account password to access REST or Git HTTPS operations has been removed, https://atlassian.community/t5/x/x/ba-p/1948231. As such this automatic test to see if 2FA is required no longer works. Therefore the check against the Bitbucket Cloud REST API has been removed in its entirety
Hi, thanks for the fix. $ git credential-manager-core --version $ git --version |
Which version of GCM are you using?
2.0.696+4365b917da
Which Git host provider are you trying to connect to?
Bitbucket DC (On prem)
Expected behavior
I am trying to clone a repo from a Bitbucket DC on prem.
GMC detects that it is a bitbucket server (I see the right host with the trace and on my gitconfig it shows the provider = bitbucket)
But redirects the authentication to bitbucket.org:
Logs
10:46:46.972059 ...GitCommandBase.cs:48 trace: [ExecuteAsync] protocol=https
10:46:46.972059 ...GitCommandBase.cs:48 trace: [ExecuteAsync] host=mybitbucket_url
10:46:46.972059 ...GitCommandBase.cs:48 trace: [ExecuteAsync] username=myusername
10:46:47.103677 ...oviderRegistry.cs:99 trace: [GetProviderAsync] Host provider override was set id='bitbucket'
10:46:47.103677 ...GitCommandBase.cs:50 trace: [ExecuteAsync] Host provider 'Bitbucket' was selected.
10:46:47.312195 ...tHostProvider.cs:103 trace: [GetStoredCredentials] Look for existing credentials under mybitbucket_url ...
10:46:47.713122 ...tHostProvider.cs:109 trace: [GetStoredCredentials] No stored credentials found
10:46:47.713122 ...tHostProvider.cs:126 trace: [GetRefreshedCredentials] Refresh credentials...
10:46:47.713122 ...tHostProvider.cs:131 trace: [GetRefreshedCredentials] Checking for refresh token...
10:46:47.713122 ...tHostProvider.cs:138 trace: [GetRefreshedCredentials] No stored refresh token found
10:46:47.713122 ...tHostProvider.cs:146 trace: [GetRefreshedCredentials] Prompt for credentials...
10:46:48.342977 ...enticationBase.cs:40 trace: [InvokeHelperAsync] Starting helper process: C:\Program Files\Git\mingw64\bin\Atlassian.Bitbucket.UI.exe userpass --username myusername
10:46:55.577219 ...tHostProvider.cs:167 trace: [GetRefreshedCredentials] Checking if two-factor requirements for credentials...
10:46:55.577219 ...tHostProvider.cs:376 trace: [RequiresTwoFactorAuthenticationAsync] Check if 2FA is required for credentials (myusername/********)...
10:46:55.593222 ...tbucketRestApi.cs:74 trace: [GetUserInformationAsync] HTTP: GET https://api.bitbucket.org/2.0/user
10:46:55.593222 ...pClientFactory.cs:58 trace: [CreateClient] Creating new HTTP client instance...
10:46:57.061702 ...pClientFactory.cs:97 trace: [CreateClient] Custom certificate verification has been enabled with certificate bundle at C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
10:46:57.517012 ...tbucketRestApi.cs:77 trace: [GetUserInformationAsync] HTTP: Response 401 [Unauthorized]
The text was updated successfully, but these errors were encountered: