Tedious: Windows authentication without username and password?

Created on 15 Dec 2017  路  12Comments  路  Source: tediousjs/tedious

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!

Most helpful comment

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 :)

All 12 comments

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

Reopened #415

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.

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 :)

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

Hi @goldpot,

What's your configuration set up?

@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"); }     
});

@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 There isn't an option for trustedConnection in any of the configuration options. Do you mean to use trustServerCertificate? Checkout API Documentation

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

Hi @IanChokS Any updates?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ricklang picture ricklang  路  9Comments

arthurschreiber picture arthurschreiber  路  8Comments

tvrprasad picture tvrprasad  路  6Comments

anthonylau picture anthonylau  路  8Comments

GuyHarwood picture GuyHarwood  路  7Comments