Skip to content

Commit 8fa5f71

Browse files
authored
Add OAuth 2.1 feature flag (#737)
1 parent b025a08 commit 8fa5f71

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@
122122
"type": "boolean",
123123
"default": false
124124
},
125+
"coder.experimental.oauth": {
126+
"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.",
127+
"type": "boolean",
128+
"default": false,
129+
"tags": [
130+
"experimental"
131+
]
132+
},
125133
"coder.sshFlags": {
126134
"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.",
127135
"type": "array",

src/promptUtils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ export async function maybeAskUrl(
138138
export async function maybeAskAuthMethod(
139139
client: CoderApi,
140140
): Promise<AuthMethod | undefined> {
141+
const experimentalOAuthEnabled = vscode.workspace
142+
.getConfiguration("coder")
143+
.get<boolean>("experimental.oauth", false);
144+
145+
if (!experimentalOAuthEnabled) {
146+
return "legacy";
147+
}
148+
141149
// Check if server supports OAuth with progress indication
142150
const supportsOAuth = await vscode.window.withProgress(
143151
{

0 commit comments

Comments
 (0)