Skip to content
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

Microsoft authentication broken on Codespaces (Web Insiders) #183754

Closed
ronakj opened this issue May 30, 2023 · 9 comments
Closed

Microsoft authentication broken on Codespaces (Web Insiders) #183754

ronakj opened this issue May 30, 2023 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded
Milestone

Comments

@ronakj
Copy link
Contributor

ronakj commented May 30, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.79.0-insiders
  • OS Version: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.57

Steps to Reproduce:

  1. Create Codespace in this repo.
  2. Switch to insiders using settings icon in bottom left.
  3. Install any extension which needs Microsoft login. I used this one https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups.
  4. After going through the login process, come back to VSCode page. The extension doesn't seem to get the auth and VSCode also doesn't have any signed in Microsoft account in the account section.

This doesn't happen in stable version. I really want to make sure this issue doesn't get propagated to stable, because our Codespaces workflow is very heavily dependent on Microsoft auth working properly.

@ronakj ronakj changed the title Microsoft authentication broken on Codespaces (Web) Microsoft authentication broken on Codespaces (Web Insiders) May 30, 2023
@TylerLeonhardt
Copy link
Member

can you provide the contents of the Microsoft Authentication output pane:
image

And also anything that shows up in Dev Tools:

  • ctrl + shift + P
  • "Dev Tools"

@TylerLeonhardt TylerLeonhardt added the info-needed Issue requires more information from poster label May 30, 2023
@ronakj
Copy link
Contributor Author

ronakj commented May 30, 2023

Microsoft Authentication (Remote) Output

2023-05-30 19:12:03.564 [info] Reading sessions from secret storage...
2023-05-30 19:12:03.564 [info] Got 0 stored sessions
2023-05-30 19:12:03.564 [info] Getting sessions for all scopes...
2023-05-30 19:12:03.564 [info] Got 0 sessions for all scopes...
2023-05-30 19:12:03.564 [info] Getting sessions for the following scopes: email offline_access openid profile
2023-05-30 19:12:03.564 [info] Got 0 sessions for scopes: email offline_access openid profile
2023-05-30 19:12:32.578 [info] Getting sessions for the following scopes: email https://management.azure.com/.default offline_access openid profile
2023-05-30 19:12:32.578 [info] Got 0 sessions for scopes: email https://management.azure.com/.default offline_access openid profile
2023-05-30 19:12:34.252 [info] Logging in for the following scopes: email https://management.azure.com/.default offline_access openid profile
Microsoft Authentication Output

2023-05-31 00:41:58.856 [info] Reading sessions from secret storage...
2023-05-31 00:41:58.856 [info] Got 0 stored sessions
2023-05-31 00:41:58.856 [info] Getting sessions for all scopes...
2023-05-31 00:41:58.856 [info] Got 0 sessions for all scopes...

Nothing relevant in Dev Tools (no errors, warnings after login)

@TylerLeonhardt
Copy link
Member

@joaomoreno looks like the UrlHandler in the Microsoft auth extension isn't firing. Any ideas why?

@TylerLeonhardt TylerLeonhardt added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels May 31, 2023
@TylerLeonhardt
Copy link
Member

One thing that’s interesting is that my open-external extension (code here) works fine:
image

but when I start either the Microsoft or GitHub auth flows… their URL Handlers in the extension never fire… so the issue appears to be before the auth extensions, but we have Core & Codespaces layers still to choose from.

Another simple repro with GitHub auth:

  • Install my Fugio extension
  • Run: Fugio: Mint Token
  • Choose either github or microsoft
  • if you choose GitHub, use workflow as the value for scopes. If you choose Microsoft, use offline_access as the value for scopes

Go through the flow. Works in Stable just fine... but not Insiders.

@TylerLeonhardt
Copy link
Member

Adding @osortega + @jkeech from the Codespaces side.

@osortega
Copy link

@TylerLeonhardt this seems to be a CORS issue happening in the extension host worker

Screenshot 2023-05-31 at 2 28 21 PM

It also seems to only happen on latest insiders, if you go back in time and use an older version everything works fine.
I'm unfamiliar with that particular request but perhaps there was a change in the request headers?

@TylerLeonhardt
Copy link
Member

@osortega I think you must be experiencing something different from myself and @ronakj. I don't even get that far where that request happens.

@joaomoreno
Copy link
Member

@TylerLeonhardt has bisected the behavior change to have happened somewhere in this commit range: 9084e08...9233de8

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jun 2, 2023

Ok so to but a brief summary here...

This was happening because the GitHub Authentication extension was running in both the web worker extension host and the remote extension host.

@alexdima pushed a change that influenced when the web worker extension host started and this issue should be fixed in the latest insiders.

However, this fix only applies to Codespaces and not Remote Tunnels. I will close this issue since it's fixed for Codespaces, but I will open another issue for Remote Tunnels.

@TylerLeonhardt TylerLeonhardt added this to the May 2023 milestone Jun 2, 2023
@TylerLeonhardt TylerLeonhardt added the candidate Issue identified as probable candidate for fixing in the next release label Jun 2, 2023
@joyceerhl joyceerhl added the verified Verification succeeded label Jun 2, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants