Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows authentication without username and password? #660

Open
kevinkuszyk opened this issue Dec 15, 2017 · 15 comments
Open

Windows authentication without username and password? #660

kevinkuszyk opened this issue Dec 15, 2017 · 15 comments

Comments

@kevinkuszyk
Copy link

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!

@Hadis-Knj
Copy link

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

@Suraiya-Hameed
Copy link
Member

Reopened #415

@kevinkuszyk
Copy link
Author

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.

@Suraiya-Hameed
Copy link
Member

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

@goldpot
Copy link

goldpot commented Oct 17, 2019

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

@IanChokS
Copy link
Member

Hi @goldpot,

What's your configuration set up?

@goldpot
Copy link

goldpot commented Oct 21, 2019

@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
Copy link

goldpot commented Oct 21, 2019

@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!

@IanChokS
Copy link
Member

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

@cargonzalv
Copy link

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

@IanChokS IanChokS reopened this Jul 27, 2020
@steflef
Copy link

steflef commented May 21, 2021

Hi @IanChokS Any updates?

@IanChokS
Copy link
Member

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

@utkarsh22garg
Copy link

utkarsh22garg commented Dec 13, 2021

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.

@Serpexx
Copy link

Serpexx commented Apr 15, 2023

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

@arthurschreiber
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants