Skip to content

Commit

Permalink
HCK-8467: reused HCK app clientId for password auth flow
Browse files Browse the repository at this point in the history
  • Loading branch information
WilhelmWesser committed Oct 24, 2024
1 parent 325b8ef commit bef47dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,6 @@
"key": "authMethod",
"value": ["Azure Active Directory (MFA)"]
}
},
{
"inputLabel": "Application (client) ID",
"inputKeyword": "clientId",
"inputType": "text",
"inputTooltip": "Azure Active Directory application id from the Overview screen of the App registration",
"dependency": {
"key": "authMethod",
"value": "Azure Active Directory (Username / Password)"
}
}
]
},
Expand Down
7 changes: 3 additions & 4 deletions reverse_engineering/databaseService/databaseService.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ const getConnectionClient = async (connectionInfo, logger) => {
? `${connectionInfo.userName}@${hostName}`
: connectionInfo.userName;
const tenantId = connectionInfo.connectionTenantId || connectionInfo.tenantId || 'common';
const clientId = connectionInfo.clientId;
const sslOptions = getSslConfig(connectionInfo);
const clientId = '0dc36597-bc44-49f8-a4a7-ae5401959b85';
const redirectUri = 'http://localhost:8080';

if (connectionInfo.authMethod === 'Username / Password') {
return await sql.connect({
Expand Down Expand Up @@ -89,8 +90,6 @@ const getConnectionClient = async (connectionInfo, logger) => {
requestTimeout: Number(connectionInfo.queryRequestTimeout) || 60000,
});
} else if (connectionInfo.authMethod === 'Azure Active Directory (MFA)') {
const clientId = '0dc36597-bc44-49f8-a4a7-ae5401959b85';
const redirectUri = 'http://localhost:8080';
const token = await getToken({ connectionInfo, tenantId, clientId, redirectUri, logger });

return await sql.connect({
Expand Down Expand Up @@ -128,7 +127,7 @@ const getConnectionClient = async (connectionInfo, logger) => {
options: {
userName: connectionInfo.userName,
password: connectionInfo.userPassword,
domain: tenantId,
tenantId,
clientId,
},
},
Expand Down

0 comments on commit bef47dc

Please sign in to comment.