Skip to content

Streamline VS Code authentication

Problem to solve

Currently we have two disparate commands to authenticate:

  • GitLab: Add Account to VS Code
  • GitLab: Authenticate to GitLab.com

This confuses people

The Add Account to VS Code also requires the instance URL to be entered manually when we can infer it from the git remote URL.

Proposal

Create new authentication flow:

  1. user wants to authenticate
  2. Assisted instance URL choice (new feature)
    • Simplified flow: If only a single git remote, use that
    • offer choice
      • All git remotes, order origin-first
      • option to enter custom URL
  3. Improved token retrieval
    • Always priority: Env Variable if the URL matches
    • OAuth for supported URLs
    • PAT for the others (not offered in simplified flow for supported URLs)
  • Return account - internally store token(s) - 1 for PAT, 2 for OAuth

Further details

Links / references