tedious icon indicating copy to clipboard operation
tedious copied to clipboard

Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

Open gladmustang opened this issue 7 years ago • 6 comments

I am using tedious 3.0.1 to connect sql server, I want to use windows authentication, my config looks like this, var config = { domain: 'XXXXCLOUD', userName: 'XX_SA_XX_XXXX_XX', password: "my pass" server: 'XX-ZU2SQLXXX.XXXXCLOUD.com', options: { database: 'dbname', encrypt: true, port: 1433 } } After run command, I got "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication." error. The sql server I am trying to connect is : sql server 2016 I am using runas command like below in my local machine, so I can try to login with correct domain: runas /netonly /env /user:XXXXCLOUD\XX_SA_XX_XXXX_XX "node tediousClientConnect" (tediousClientConnect is my node client app which using tedious to connect sql)

Can anyone help to provide a solution on this ?

gladmustang avatar Dec 10 '18 04:12 gladmustang

@gladmustang I am not able to help with this info 🤷‍♀️ but the error is telling what could be the potential issue. are you able to connect to the server using SSMS with the same config? if you're able to run the same script using runas then the issue should be in env setup not in tedious

Hadis-Fard avatar Dec 12 '18 17:12 Hadis-Fard

Hi Hadis-Fard, I can use SSMS with the same command, so I think it will not be the env issue. runas /netonly /env /user:XXXXCLOUD\XX_SA_XX_XXXX_XX ssms Also, I tried msnodesqlv8 with similiar command, and I can connect to remote DB, so I think it should not be the env issue. Do you need me to provide other information that may help you to track issue ?

gladmustang avatar Dec 13 '18 15:12 gladmustang

Sometimes the server requires passing through the workstation name as well. Unfortunately, we currently don't expose that option. I'll see if I can open a PR to allow this, and maybe you can then see if that helps you in your case.

Sorry you're facing this trouble. 🙇

arthurschreiber avatar Dec 13 '18 16:12 arthurschreiber

Hi arthurschreiber, Thanks for response and help, waiting for your further update.

gladmustang avatar Dec 14 '18 03:12 gladmustang

I might be facing the same issue

BenjaminVanRyseghem avatar Apr 11 '19 12:04 BenjaminVanRyseghem

Hi @gladmustang, are you still facing the same issue with the latest tedious version?

IanChokS avatar Dec 13 '19 21:12 IanChokS