Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@
"type": "boolean",
"default": false
},
"coder.experimental.oauth": {
"markdownDescription": "Enable [OAuth 2.1](https://coder.com/docs/admin/integrations/oauth2-provider) authentication. When enabled, you'll be prompted to choose between OAuth and session token authentication during login. OAuth provides automatic token refresh, eliminating the need to manually re-authenticate when your session expires.",
"type": "boolean",
"default": false,
"tags": [
"experimental"
]
},
"coder.sshFlags": {
"markdownDescription": "Additional flags to pass to the `coder ssh` command when establishing SSH connections. Enter each flag as a separate array item; values are passed verbatim and in order. See the [CLI ssh reference](https://coder.com/docs/reference/cli/ssh) for available flags.\n\nNote: `--network-info-dir` and `--ssh-host-prefix` are ignored (managed internally). Prefer `#coder.proxyLogDirectory#` over `--log-dir`/`-l` for full functionality.",
"type": "array",
Expand Down
8 changes: 8 additions & 0 deletions src/promptUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ export async function maybeAskUrl(
export async function maybeAskAuthMethod(
client: CoderApi,
): Promise<AuthMethod | undefined> {
const experimentalOAuthEnabled = vscode.workspace
.getConfiguration("coder")
.get<boolean>("experimental.oauth", false);

if (!experimentalOAuthEnabled) {
return "legacy";
}

// Check if server supports OAuth with progress indication
const supportsOAuth = await vscode.window.withProgress(
{
Expand Down