Can not login into Bitbucket Cloud from Visual Studio Codspaces (cloud ide)

Issue #429 open
Arpit Shah created an issue
  • I am able to connect to my bitBucket Rep from Vs Code( installed version). When I tried to do the same from Visual Studio Code Space( cloud ide), the authentication fails.
  • Option for Loggin into “Bitbucket cloud” opens up the following url, that does not work:

Official response

  • Nick Rundquist

    We released version 2.8.3 of the extension today that allows for an alternative authentication method for Jira Cloud and Bitbucket Cloud that we’re testing. It should allow for authentication when using Codespaces as well as easier authentication when using remote development.

    To try the new method:

    • Go to the VS Code settings (not the settings for the extension) and search for “use new auth”. Enable the setting for our extension.
    • Go to the Atlassian extension settings and select “Login to Jira Cloud” or “Login to Bitbucket Cloud”.
    • The OAuth dance should proceed as usual.
    • If you’re using VS Code the page should automatically redirect you back to the application and your sites should be added to the Authentication section of the settings.
    • If you’re using Codespaces you’ll need to click the link in the “Redirect didn’t work?” section of the Success page to be redirected to Codespaces.
    • If that link doesn’t work:

      • Please let us know.
      • You can click the “Manually Add … Code” button in the Authentication section of the extension settings.
      • Paste the the code from the Success page in to the “Authorization Code” dialog.

    This should allow you to authenticate successfully. Please let us know how it goes, successful or otherwise, so we can improve the experience.

Comments (27)

  1. Nick Rundquist

    @Arpit Shah , we don’t currently support Visual Studio Cloudspace. We’re evaluating what we’ll need to do to create and store credentials when not running locally.

  2. Nick Rundquist

    Alec Davila, If you’re connecting to WSL you can’t authenticate while running in the remote environment, however, you can authenticate while running locally and that authentication will continue to work when working in the remote environment.

  3. Arpit Shah reporter

    Do you have any workaround? I need to create the project in VS code space, from the folder that is on my Bitbucket repository.

    Is there a way we can use existing auth mechanism to work on cloud ide? I am running it from Mac OS

  4. Nick Rundquist

    We have a task on the backlog to allow for authentication in remote environments. Until we complete that work I don’t know of a workaround for Codespaces.

  5. Arpit Shah reporter

    Thanks Nick for your replying to my query.

    Is it possible to get notification once the task is complete from your side?

    Is it feasible to know approximate timeframe for the completion of the task?

  6. Nick Rundquist

    I don’t see another Bitbucket issue for this so I’ll make this the public tick to track it. We’ll update this ticket when we’ve released the new authentication method.

    I’m not ready to set a timeline for this work yet.

  7. Colin McClure

    Same issue here as @Rafed Alwani . Cannot login via VSCode on Windows 10 Pro machine. Redirects to 127.0.0.1: <<port>>.

  8. Nick Rundquist

    @Rafed Alwani @Colin McClure Are you working on a local project or are you using the remote development feature to work via SSH, WSL or a container?

  9. Deepak Sehrawat

    Facing the same issue. I am using code-server on a cloud server (EC2 instance). It would be great if someone can suggest a work-around; probably by invoking such authentication via command line on the cloud server running code-server (or anything else)?

  10. Nick Rundquist

    We released version 2.8.3 of the extension today that allows for an alternative authentication method for Jira Cloud and Bitbucket Cloud that we’re testing. It should allow for authentication when using Codespaces as well as easier authentication when using remote development.

    To try the new method:

    • Go to the VS Code settings (not the settings for the extension) and search for “use new auth”. Enable the setting for our extension.
    • Go to the Atlassian extension settings and select “Login to Jira Cloud” or “Login to Bitbucket Cloud”.
    • The OAuth dance should proceed as usual.
    • If you’re using VS Code the page should automatically redirect you back to the application and your sites should be added to the Authentication section of the settings.
    • If you’re using Codespaces you’ll need to click the link in the “Redirect didn’t work?” section of the Success page to be redirected to Codespaces.
    • If that link doesn’t work:

      • Please let us know.
      • You can click the “Manually Add … Code” button in the Authentication section of the extension settings.
      • Paste the the code from the Success page in to the “Authorization Code” dialog.

    This should allow you to authenticate successfully. Please let us know how it goes, successful or otherwise, so we can improve the experience.

  11. Deepak Sehrawat

    @Nick Rundquist . Thanks for the update. I tried the extension version 2.8.3 on Ubuntu machine with ‘code-server’. I could see the “use new auth” option and enabled it. But as shown in the below (attached) snapshot, I don’t see any thing on the Authentication page of the extension; even when I click on “sign in to bitbucket”.

    What could be the reason?

  12. Nick Rundquist

    Hmm, I’ve seen that on Firefox but Chrome should work. Can you try opening the settings page with the Chrome Developer Tools open (ctrl-shift-i) and letting me know if there are any error messages.

  13. Daniel Frankcom

    The steps for using the new authentication method worked for me when I had the same problem. 👍

  14. Sandy Garrido

    Hi @Nick Rundquist Please see the request below that fails as mentioned in OP. (I have altered some urls here just to remove anything that may compromise my acc security, not sure that it would but just to be safe)
    I hope this helps!

    nb, i’ve copied this from chrome as fetch but you can still gather the data you need

    fetch("https://api.segment.io/v1/t", {
      "headers": {
        "accept": "*/*",
        "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
        "content-type": "text/plain",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "cross-site"
      },
      "referrer": "https://api.atlassian.com/",
      "referrerPolicy": "strict-origin-when-cross-origin",
      "body": "{\"timestamp\":\"2020-11-11T22:38:26.276Z\",\"context\":{\"page\":{\"url\":\"https://api.atlassian.com/oauth2/authorize/consent\",\"path\":\"/oauth2/authorize/consent\",\"search\":\"\",\"referrer\":\"\",\"title\":\"Authorize app\"},\"referrer\":\"\",\"url\":\"https://api.atlassian.com/oauth2/authorize/consent\",\"userAgent\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36\",\"locale\":\"en-GB\",\"library\":{\"name\":\"analytics.js\",\"version\":\"4.0.4\"},\"campaign\":{}},\"integrations\":{},\"properties\":{\"actionSubjectId\":\"acceptConsent\",\"source\":\"oauth2ConsentScreen\",\"attributes\":{\"forScopes\":[\"read:jira-work\",\"manage:jira-project\",\"read:jira-user\",\"write:jira-work\"]}},\"event\":\"ui.button.clicked\",\"messageId\":\"ajs-8c7aec0f3f8d35c84c066d74f18ae1ab\",\"anonymousId\":\"80d2d764-69e8-4891-abc2-c091bc361fde\",\"type\":\"track\",\"writeKey\":\"DPfxUYDsNr0Vj83d3NDwHcmCPHYpFFZ8\",\"userId\":\"5a045d0bf491f53c4fcbd6db\",\"sentAt\":\"2020-11-11T22:38:26.279Z\",\"_metadata\":{\"bundled\":[\"Segment.io\"],\"unbundled\":[]}}",
      "method": "POST",
      "mode": "cors"
    }); ;
    fetch("https://api.atlassian.com/oauth2/authorize/consent/grant?state=g6Fo2qwedzenJnYmhIRlhQajFpRjYxM1dobaN0aWTZIHhrZVpTeGctaW9EaW9CZ1VMcGVUYUZ2MGg0M2Q1Y1pMo2NpZNkgYkpDaFZnQlFkMGFOVVB1Rlo4WXpZQlZaejNYNFFUZTI&auth0Url=https://auth.atlassian.com", {
      "headers": {
        "accept": "application/json",
        "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
        "content-type": "application/json",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "cookie": "ajs_anonymous_id=%2280d2d764-69e8-4891-abc2-c091bc361fde%22; __cid=5cdabbce-83c5-4de2-a171-f4ed9f8de6fe-a9adas69ee825969ee18ab73f; __aid_user_id=5a045d0bf491f53c4fcbd6db; atlCohort={\"bucketAll\":{\"bucketedAtUTC\":\"2020-11-09T12:15:14.463Z\",\"version\":\"2\",\"index\":92,\"bucketId\":0}}; optimizelyEndUserId=oeu1604924114741r0.8781853954365704; atl_xid.xc=%7B%22value%22%3A%22b94292b1-5105-4a2e-a401-bce7b43cafce%22%2C%22createdAt%22%3A%222020-11-09T12%3A15%3A16.001Z%22%2C%22type%22%3A%22xc%22%7D; atlUserHash=1393648548; _ga=GA1.2.764216215.1604924116; _sio=80d2d764-69e8-4891-abc2-c091bc361fde; ajs_user_id=%225a045d0bf491f53c4fcbd6db%22; _cs_c=1; _cs_id=026d67b6-09ed-a950-f6f1-1155c48a1563.1604924116.1.1604924116.1604924116.1.1639088116553.Lax.0; _CT_RS_=Recording; WRUIDAWS=3028643295806249; __CT_Data=gpv=1&ckp=tld&dm=atlassian.com&apv_45_www33=1&cpv_45_www33=1&rpv_45_www33=1; seg_xid=4a1b8f88-0561-48fc-843f-e86aed6bfd30; OptanonAlertBoxClosed=2020-11-11T22:36:50.493Z; __atl_path=4b447cbfd4134c229d3332a48f109154; OptanonConsent=landingPath=NotLandingPage&datestamp=Wed+Nov+11+2020+22%3A38%3A19+GMT%2B0000+(Greenwich+Mean+Time)&version=4.3.3&EU=true&groups=0_144275%3A1%2C101%3A1%2C1%3A1%2C2%3A1%2C103%3A1%2C0_144389%3A1%2C105%3A1%2C3%3A1%2C0_145087%3A1%2C112%3A1%2C0_145849%3A1%2C4%3A1%2C113%3A1%2C0_146519%3A1%2C125%3A1%2C0_147366%3A1%2C126%3A1%2C0_149658%3A1%2C127%3A1%2C0_150360%3A1%2C128%3A1%2C0_150361%3A1%2C131%3A1%2C0_152586%3A1%2C134%3A1%2C0_177825%3A1%2C0_144574%3A1%2C0_145089%3A1%2C0_147243%3A1%2C0_147316%3A1%2C0_147317%3A1%2C0_147320%3A1%2C0_147327%3A1%2C0_150364%3A1%2C0_150452%3A1%2C0_151725%3A1%2C0_151744%3A1%2C0_151754%3A1%2C0_155093%3A1%2C0_152355%3A1%2C0_147367%3A1%2C0_162785%3A1%2C0_148475%3A1%2C0_154648%3A1%2C0_147315%3A1%2C0_154645%3A1%2C0_155091%3A1%2C0_142671%3A1%2C0_154646%3A1%2C0_155092%3A1%2C0_150368%3A1&AwaitingReconsent=false"
      },
      "referrer": "https://api.atlassian.com/oauth2/authorize/consent?state=g6Fo2SBaVWNNOENsdmpMVldzenJnasdN0aWTZIHhrZVpTeGctaW9EaW9CZ1VMcGVUYUZ2MGg0M2Q1Y1pMo2NpZNkgYkpDaFZnQlFkMGFOVVB1Rlo4WXpZQlZaejNYNFFUZTI",
      "referrerPolicy": "strict-origin-when-cross-origin",
      "body": "{\"cloudId\":\"eac835e5-5b3a-425d-b891-4de179396c83\",\"product\":\"Jira API\"}",
      "method": "POST",
      "mode": "cors"
    }); ;
    fetch("https://auth.atlassian.com/decision", {
      "headers": {
        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
        "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
        "cache-control": "max-age=0",
        "content-type": "application/x-www-form-urlencoded",
        "sec-fetch-dest": "document",
        "sec-fetch-mode": "navigate",
        "sec-fetch-site": "same-site",
        "sec-fetch-user": "?1",
        "upgrade-insecure-requests": "1",
        "cookie": "ajs_anonymous_id=%2280d2d764-69e8-4891-abc2-c091bc361fde%22; __cid=5cdabbce-83c5-4de2-a171-f4ed9f8de6fe-a9aa069ee825969ee18ab73f; __aid_user_id=5a045d0bf491f53c4fcbd6db; atlCohort={\"bucketAll\":{\"bucketedAtUTC\":\"2020-11-09T12:15:14.463Z\",\"version\":\"2\",\"index\":92,\"bucketId\":0}}; optimizelyEndUserId=oeu1604924114741r0.8781853954365704; atl_xid.xc=%7B%22value%22%3A%22b94292b1-5105-4a2e-a401-bce7b43cafce%22%2C%22createdAt%22%3A%222020-11-09T12%3A15%3A16.001Z%22%2C%22type%22%3A%22xc%22%7D; atlUserHash=1393648548; _ga=GA1.2.764216215.1604924116; _sio=80d2d764-69e8-4891-abc2-c091bc361fde; ajs_user_id=%225a045d0bf491f53c4fcbd6db%22; _cs_c=1; _cs_id=026d67b6-09ed-a950-f6f1-1155c48a1563.1604924116.1.1604924116.1604924116.1.1639088116553.Lax.0; _CT_RS_=Recording; WRUIDAWS=3028643295806249; __CT_Data=gpv=1&ckp=tld&dm=atlassian.com&apv_45_www33=1&cpv_45_www33=1&rpv_45_www33=1; seg_xid=4a1b8f88-0561-48fc-843f-e86aed6bfd30; did=s%3Av0%3A5fed45c0-246e-11eb-9e92-d594f6421f0a.62xMvPfWVPtfS8WKxrMNLMKSH86a1hwxjeFZUz%2FsgJU; did_compat=s%3Av0%3A5fed45c0-246e-11eb-9e92-d594f6421f0a.62xMvPfWVPtfS8WKxrMNLMKSH86a1hwxjeFZUz%2FsgJU; OptanonAlertBoxClosed=2020-11-11T22:36:50.493Z; auth0=s%3AwgSzLv9sRvfhivE6-uFsGC30zyFosrQS.qvZRu%2FLipEpB2LZrt6N2MP%2B2qYjkI79adoSfTackAAc; auth0_compat=s%3AwgSzLv9sRvfhivE6-uFsGC30zyFosrQS.qvZRu%2FLipEpB2LZrt6N2MP%2B2qYjkI79adoSfTackAAc; __atl_path=4b447cbfd4134c229d3332a48f109154; OptanonConsent=landingPath=NotLandingPage&datestamp=Wed+Nov+11+2020+22%3A38%3A19+GMT%2B0000+(Greenwich+Mean+Time)&version=4.3.3&EU=true&groups=0_144275%3A1%2C101%3A1%2C1%3A1%2C2%3A1%2C103%3A1%2C0_144389%3A1%2C105%3A1%2C3%3A1%2C0_145087%3A1%2C112%3A1%2C0_145849%3A1%2C4%3A1%2C113%3A1%2C0_146519%3A1%2C125%3A1%2C0_147366%3A1%2C126%3A1%2C0_149658%3A1%2C127%3A1%2C0_150360%3A1%2C128%3A1%2C0_150361%3A1%2C131%3A1%2C0_152586%3A1%2C134%3A1%2C0_177825%3A1%2C0_144574%3A1%2C0_145089%3A1%2C0_147243%3A1%2C0_147316%3A1%2C0_147317%3A1%2C0_147320%3A1%2C0_147327%3A1%2C0_150364%3A1%2C0_150452%3A1%2C0_151725%3A1%2C0_151744%3A1%2C0_151754%3A1%2C0_155093%3A1%2C0_152355%3A1%2C0_147367%3A1%2C0_162785%3A1%2C0_148475%3A1%2C0_154648%3A1%2C0_147315%3A1%2C0_154645%3A1%2C0_155091%3A1%2C0_142671%3A1%2C0_154646%3A1%2C0_155092%3A1%2C0_150368%3A1&AwaitingReconsent=false"
      },
      "referrer": "https://api.atlassian.com/",
      "referrerPolicy": "strict-origin-when-cross-origin",
      "body": "audience=api.atlassian.com&state=g6Fo2SBaVWNNOENsdmpMVldzenJnYmhIRlhQajFp9999ZIHhrZVpTeGctaW9EaW9CZ1VMcGVUYUZ2MGg0M2Q1Y1pMo2NpZNkgYkpDaFZnQlFkMGFOVVB1Rlo4WXpZQlZaejNYNFFUZTI&cancel=&scope%5B%5D=read%3Ajira-work&scope%5B%5D=manage%3Ajira-project&scope%5B%5D=read%3Ajira-user&scope%5B%5D=write%3Ajira-work&scope%5B%5D=offline_access",RjYxM1dobaN0aWT
      "method": "POST",
      "mode": "cors"
    }); ;
    fetch("http://127.0.0.1:31415/jiracloud?code=r_F3ICnBkGRSmFhg&state=g6Fo2SBTUGs3dTZrSDlSRURJeD9999aDVVWGlrazRSYaN0aWTZIFV1UDQ1cFZtbzNxc1pZZ2dnN0VOMDhxWTRfa1pRTDNPo2NpZNkgYkpDaFZnQlFkMGFOVVB1Rlo4WXpZQlZaejNYNFFUZTI", {
      "headers": {
        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
        "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
        "cache-control": "max-age=0",
        "sec-fetch-dest": "document",
        "sec-fetch-mode": "navigate",
        "sec-fetch-site": "cross-site",
        "sec-fetch-user": "?1",
        "upgrade-insecure-requests": "1"
      },
      "referrerPolicy": "strict-origin-when-cross-origin",
      "body": null,
      "method": "GET",
      "mode": "cors"
    });
    

  15. Log in to comment