vscode-extension-tester icon indicating copy to clipboard operation
vscode-extension-tester copied to clipboard

[🚀 Request] How to provide vscode-style authentication via API

Open YuggothFungi opened this issue 3 years ago • 1 comments

Expected Behavior

  • Some programmatic way to send vscode://url to the instance of VSBrowser

Actual Behavior

  • None found

Steps to Reproduce the Problem

Manual steps are:

  1. VS code creates an URL to the web server
  2. User logs in on the web server and is provided with token from oauth server
  3. Token is returned as vscode://url (vs code's personal app protocol) that is pushed into browser, thus redirecting the call to vs code application
  4. User confirms to pass the URL to VS code and then confirms receiving the URL inside VS code instance - authentication is successful.

How I planned to solve the issue:

  1. Get vscode://url string from oauth server - OK
  2. Request vscode://url by any means - NO SOLUTION FOUND
  3. Wait for notification inside VS Code browser to accept that url - PENDING, but should be trivial

I tried several different ways:

  1. created python script that runs vscode://url. But in my case it starts a new instance of VS Code instead of transferring the URL to Extension host instance.
  2. inside "it" test called await driver.get('vscode://url') - nothing happens
  3. installed matching chromium version and running the same driver.get('vscode://url') from it - it starts new instance of Browser, thus ending my test.

Specifications

  • VSCode version: 1.71.2
  • ExTester version: 4.4.1
  • Platform:
    • [ x ] Linux
    • [ x ] Windows

YuggothFungi avatar Sep 29 '22 15:09 YuggothFungi

Currently I can work around this by using CLI command to start VS Code with added " --open-url -- "vscode://url" " arguments.

YuggothFungi avatar Oct 03 '22 09:10 YuggothFungi