Cannot log into BitBucket account with personal token

Issue #500 resolved
Juanpe Araque created an issue

Hi,

I am using the Atlassian VSCode extension to log into Bitbucket and manage PRs from there. Since the extension does not support SSO login and my company uses SSO to connect (I have no password for our Bitbucket instance) I created a personal access token to connect with it.

It has been working more or less perfectly until the recent VSCode update. Suddenly I was kicked out of the extension and I was never able to login again. The erro says:

Error authenticating with Bitbucket: Error: Request failed with status code 401

And if I try running the curl command myself I get the CAPTCHA error message, which I also saw in the extension the first time but then was not shown anymore.

Personal token access should not be triggering the CAPTCHA error but somehow it is. I have uninstalled/reinstalled the extension and revoked and created a new personal token. None of it seems to work… I am not the only one with this issue in my company. It seems that all happened after the latest VSCode update. Not sure if the latest keychain change they implemented might have something to do with it.

Comments (7)

  1. Nick Rundquist

    If you log out of Bitbucket on the web and then log back in are you able to solve the CAPTCHA and resolve the issue?

  2. Juanpe Araque reporter

    Nope :S, I tried to log out and log in again several times and I do not see anything related with the captcha or any kind of request. It is important to notice the Captcha message only appears if I run the curl method that appears in the extension logs being run. The error that is shown in the extension itself is the one I wrote in the issue description which I am not sure if they are related.

  3. Juanpe Araque reporter

    So, I think I found the issue although I am not sure why it happened and how to fix it.

    The extension seems to store credentials in the atlascode-authinfoV3 entry in the keychain. For some reason, that entry has not been created for me. It disappeared after the updated and never got recreated. Some colleague of had the same issue and they just recreated the token and everything worked again. Looks like the entry was created properly and that’s it. For some reason that did not happen to me and there is nothing in the keychain that would allow the extension to store the credentials.

    Any advice about how to fix this? I have reinstalled the extension but it does not seem to be working, probably I have some left overs?

  4. Juanpe Araque reporter

    Just another piece of information in case it helps.

    I reinstalled the extension and logged in with Bitbucket cloud and everything worked just fine. And the keychain entry was added. I tried then loggin in with the custom server and the same error appears. If I delete the cloud login the keychain entry disappears.

    If the issue is the captcha, how can I fix it? We use SSO and when I log out and log in again the SSO verification sends me straight to my account. I do not see any captcha to act upon.

  5. Juanpe Araque reporter

    Ok, good news. I talked with my system admin to see if they can clear my captcha and after they did I can login normally. The issue seems to be related with many attempts to log in until I have permissions to access the keychain entry.

    The error message only said, 401 error. It could be good to properly show what the error is because if I wouldn’t have tried to ping the api myself I would have never figured it out… Probably avoid so many retries with a failing password is a good idea as well.

    Anyhow, it is working now!

  6. Log in to comment