Skip to content

Commit

Permalink
Don't prompt for Server Manager credentials when using minimal securi…
Browse files Browse the repository at this point in the history
…ty (#1351)
  • Loading branch information
isc-bsaviano authored Apr 24, 2024
1 parent d144665 commit cee4a1e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,15 @@ export async function resolveConnectionSpec(serverName: string): Promise<void> {
export async function resolvePassword(serverSpec): Promise<void> {
const AUTHENTICATION_PROVIDER = "intersystems-server-credentials";
// This arises if setting says to use authentication provider
if (typeof serverSpec.password === "undefined") {
const scopes = [serverSpec.name, serverSpec.username || ""];
if (
// Connection isn't unauthenticated
serverSpec.username != undefined &&
serverSpec.username != "" &&
serverSpec.username.toLowerCase() != "unknownuser" &&
// A password is missing
typeof serverSpec.password == "undefined"
) {
const scopes = [serverSpec.name, serverSpec.username];
let session = await vscode.authentication.getSession(AUTHENTICATION_PROVIDER, scopes, { silent: true });
if (!session) {
session = await vscode.authentication.getSession(AUTHENTICATION_PROVIDER, scopes, { createIfNone: true });
Expand Down

0 comments on commit cee4a1e

Please sign in to comment.