tedious icon indicating copy to clipboard operation
tedious copied to clipboard

Windows authentication without username and password?

Open kevinkuszyk opened this issue 7 years ago • 15 comments

Should windows auth be working without a username and password? I can only make it work when my config looks like this:

var config = {
  server: 'localhost',
  domain: 'laptop',
  userName: 'username',
  password: 'password'
}

After reading though the thread on #415, I got the impression it should?

Thanks!

kevinkuszyk avatar Dec 15 '17 14:12 kevinkuszyk

@kevinkuszyk integrated authentication support #624 is implemented but has not been merged into master yet, stay tuned 😃

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

Reopened #415

Suraiya-Hameed avatar Dec 15 '17 20:12 Suraiya-Hameed

Thanks for the quick reply. Do you have an ETA for a release to npm?

In the meantime, how stable is it? We don't need it for use in a production app - our use case is connecting to SQL to setup databases before we run our Angular e2e tests. If it's reasonably stable and you're tuning performance that's good enough for us and I'll pull the latest from GitHub while we wait for an official release.

kevinkuszyk avatar Dec 18 '17 09:12 kevinkuszyk

Implementation for Windows integrated authentication is stable. It depends on node-gyp package and that in turn needs C++ tool chain and few other dependencies, we didn't want to force all existing users to install these dependencies. Moreover those dependencies are hard to install in Azure web app(not sure if its possible to install them!), that's the reason it's not in master. PR #624 is almost ready, once it is finalized, we will visit Windows authentication :)

Suraiya-Hameed avatar Dec 18 '17 18:12 Suraiya-Hameed

Has windows authentication been implemented? I am getting a weird error when I try to access a table from the MSSQL DB - Requests can only be made in the LoggedIn state, not the SentLogin7WithStandardLogin state - I have tedious:6.4.0 -- not able to connect to the DB at all

goldpot avatar Oct 17 '19 23:10 goldpot

Hi @goldpot,

What's your configuration set up?

IanChokS avatar Oct 21 '19 20:10 IanChokS

@IanChokS Below is my config - I can connect to the same DB using username and password - but cannot connect using Windows authentication

var Connection = require('tedious').Connection;
var Request = require('tedious').Request; var TYPES = require('tedious').TYPES; var config = {
server: 'Server_name', //update me authentication: { type: 'default', options: {
trustedConnection: true, instanceName: '' } }, options:{ debug:{ packet:true, data:true, payload:true, token:false, log:true, },
database: 'DBNAME',
port:1433 }

};  
var connection = new Connection(config);  
connection.on('connect', function(err) {  
    // If no error, then good to proceed.
    if(err)
    {
        console.error('Connection error',err);
    }else{
    console.log("Connected"); }     
});  

goldpot avatar Oct 21 '19 20:10 goldpot

@IanChokS - the error I get is Login failed for user ''. This is when I use windows authentication ( trustedConnection : true). If I connect using the username and password fields ( sql authenticated) then I am able to connect. Thanks for your hep!

goldpot avatar Oct 21 '19 21:10 goldpot

@goldpot There isn't an option for trustedConnection in any of the configuration options. Do you mean to use trustServerCertificate? Checkout API Documentation

IanChokS avatar Oct 23 '19 16:10 IanChokS

Hi @IanChokS, why is this closed? We are still not able to use windows authentication with Tedious

cargonzalv avatar Jul 24 '20 23:07 cargonzalv

Hi @IanChokS Any updates?

steflef avatar May 21 '21 01:05 steflef

Hi sorry for the delay. I'll try to look into this !

IanChokS avatar May 27 '21 21:05 IanChokS

Hi,

Checking in here to know if support for windows authentication has been added to node-mssql yet ?

If not, is there any ETA when it will be added.

utkarsh22garg avatar Dec 13 '21 10:12 utkarsh22garg

Hi,

Checking in here to know if support for windows authentication has been added to node-mssql yet ?

If not, is there any ETA when it will be added.

Its only been 6 years, give it another 7, kindly be patient

Serpexx avatar Apr 15 '23 02:04 Serpexx

Its only been 6 years, give it another 7, kindly be patient

Comments like this are super disappointing. tedious is a free project, mainly supported by people working on it in their free time. If you'd like to see windows integrated authentication, nothing is preventing you from investing the time and adding support for it yourself.

arthurschreiber avatar Apr 15 '23 13:04 arthurschreiber