From fb2e261a0894c18ef351aab49829df32c9503238 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Mon, 5 Aug 2024 11:56:49 +0200 Subject: [PATCH] azure auth --- packages/api/src/controllers/connections.js | 4 ++-- packages/web/src/utility/api.ts | 4 ++-- plugins/dbgate-plugin-mssql/src/backend/azureAuth.js | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/api/src/controllers/connections.js b/packages/api/src/controllers/connections.js index 30bd5659..428bb3d6 100644 --- a/packages/api/src/controllers/connections.js +++ b/packages/api/src/controllers/connections.js @@ -400,7 +400,7 @@ module.exports = { const driver = requireEngineDriver(connection); const accessToken = await driver.getAuthTokenFromCode(connection, { code, redirectUri }); const volatile = await this.saveVolatile({ conid, accessToken }); - console.log('******************************** WE HAVE ACCESS TOKEN', accessToken); - socket.emit('got-volatile-token', { conid, volatileConId: volatile._id }); + // console.log('******************************** WE HAVE ACCESS TOKEN', accessToken); + socket.emit('got-volatile-token', { savedConId: conid, volatileConId: volatile._id }); }, }; diff --git a/packages/web/src/utility/api.ts b/packages/web/src/utility/api.ts index c2ce59bd..c9082a6a 100644 --- a/packages/web/src/utility/api.ts +++ b/packages/web/src/utility/api.ts @@ -224,8 +224,8 @@ export function getVolatileConnections() { } export function installNewVolatileConnectionListener() { - apiOn('got-volatile-token', ({ conid, volatileConId }) => { - setVolatileConnectionRemapping(conid, volatileConId); + apiOn('got-volatile-token', ({ savedConId, volatileConId }) => { + setVolatileConnectionRemapping(savedConId, volatileConId); }); } diff --git a/plugins/dbgate-plugin-mssql/src/backend/azureAuth.js b/plugins/dbgate-plugin-mssql/src/backend/azureAuth.js index 2394c928..5ebca70d 100644 --- a/plugins/dbgate-plugin-mssql/src/backend/azureAuth.js +++ b/plugins/dbgate-plugin-mssql/src/backend/azureAuth.js @@ -10,8 +10,13 @@ async function azureGetAuthTokenFromCode(connection, code) { return null; } +function getAzureAuthOptions(connection) { + return null; +} + module.exports = { getAzureAuthTypes, azureGetRedirectAuthUrl, azureGetAuthTokenFromCode, + getAzureAuthOptions, };