Draft: feat(oauth): support custom redirect URI for browser-based workspaces

Description

Problem

The OAuth flow fails in browser-based workspaces because the extension hardcodes a desktop protocol redirect URI (vscode://gitlab.gitlab-workflow/authentication) which is unavailable in browser environments.

Solution

Based on the suggestions in this comment, the extension now uses vscode.env.asExternalUri API and supports configurable OAuth parameters via environment variables:

  • GITLAB_WORKFLOW_OAUTH_REDIRECT_URI — overrides the default redirect_uri
  • GITLAB_WORKFLOW_OAUTH_CLIENT_ID — overrides the configured OAuth client ID

When these variables are set, the extension uses them for the OAuth flow and encodes the workspace callback URI in the OAuth state parameter, so the authorization code can be delivered back to the correct workspace.

When these environment variables are not set, the existing desktop OAuth flow (vscode:// redirect) works unchanged.

Resolves #700

How has this been tested?

  • If src/browser or src/common has been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE.
  • Consider an end-to-end test for significant new features that aren't covered by integration tests.

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Roman Nikitenko

Merge request reports

Loading
Loading