atlassian / atlassian/atlascode
Login fails when using WSL
- Dominant language
- TypeScript
- Stars
- 129
- Forks
- 82
- Avg merge
- 3h 3m
- Merged PRs (30d)
- 6
Description
**Describe the bug**
When using Windows Subsystem for Linux (WSL), the Jira and Bitbucket logins do not work.
- The buttons for both say "Login to Jira" or "Login to Bitbucket" instead of "Login to Jira Cloud" and "Login to Bitbucket Cloud".
- Clicking "Login to Bitbucket" opens a web browser which navigates to an Atlassian sight, then redirects to a localhost port using the IP `127.0.0.1`.
- Since VS Code is actually running within the WSL, this IP address does not correctly point to the actual machine, so it simply says the webpage doesn't exist.
- Clicking "Login to Jira" simply fails with an unauthenticated error. No webpage is opened.
**To Reproduce**
Steps to reproduce the behavior:
1. Setup WSL
2. Connect VS Code to WSL
- This may require the WSL and Remote SSH extensions
3. Try to login
**Expected behavior**
1. The login buttons should be the same as what I see when running on MacOS (they should say login to the cloud)
2. Clicking the login buttons should automatically login, or require a username and password. It may or may not open a browser window.
3. The redirection should use the correct IP address for the system hosting VS Code.
**Environment and Version (please complete the following information):**
- Atlassian Plugin Version (3.4.14)
- Visual Studio Code Version (1.98.0)
- Is this a local or cloud environment? Local editor, Atlassian Cloud (not sure which this question is referring to)
- If Cloud, Browser (chrome, safari): Chrome
- If Local, OS (macOS, windows, linux): Windows with WSL
**Additional context**
I found that if I replace the IP address `127.0.0.1` with the WSL localhost name `wsl.localhost` and keep the port number, it correctly logs me in. This shows that the issue is just that it is redirecting to the wrong location. The extension should be able to choose where it redirects, and it should correctly detect the hostname automatically.
Contributor guide
Research direction
No source files, tests, or entry points are named in the issue. Reproduce both Jira and Bitbucket login flows from VS Code connected to WSL, then trace how the browser callback host and port are selected; done means both Cloud login buttons work and the redirect reaches the VS Code host rather than 127.0.0.1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, typescript, vscode
- Domain
- authentication, devtools, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100