title: Failed to connect SQL Server from Node.js using tedious
body: <p>I am trying to connect to SQL Server in our domain network. I am able to connect using python but not able to connect in Node.js using Tedious.</p>
  <p>Node.js code snippet:</p>
  <pre><code>     var config = {
                 server: 'serverName.domain.com',
                 authentication: {
                         type: 'default',
                         options: {
                           userName: 'DOMAINID\\username',
                           password: 'password'
                                   }
                                 },
                  options: {
                        database: 'dbName',
                        port: 1234,
                            }
                };
  
  var connection = new Connection(config);
  
    connection.on('connect', function (err) {
      if (err) {
        console.log('err', err);
      } else {
       console.log(&quot;Connected&quot;);
       executeStatement();
     } 
   }); 
  connection.connect();
  </code></pre>
  <p>Receiving error:</p>
  <blockquote>
  <p>Login Failed for the user DOMAINID/username. The login is from an untrusted domain and cannot be used with Windows authentication.</p>
  </blockquote>
  <p>But when trying to connect from Python, I am able to connect successfully.</p>
  <p>Python snippet:</p>
  <pre><code>import sqlalchemy
  
  conn = sqlalchemy.create_engine('mssql+pymssql://DOMAINID\\username:password@serverName.domain.com:1234/dbName')
  print(conn.execute('SELECT * FROM table_name').fetchall())
  </code></pre>
  <p>Data received successfully in python.</p>
  <p>And also I tried with mssql and msnodesqlv8 with Microsoft ODBC 11 for Microsoft SQL Server drivers.</p>
  <p>I am able to connect. Following is the code snippet.</p>
  <pre><code>const sql = require(&quot;mssql/msnodesqlv8&quot;);
  
  const main = async () =&gt; {
  const pool = new sql.ConnectionPool({
      server: &quot;server.domain.com&quot;,
      database: &quot;dbName&quot;,
      port: 1234,
      user:'DomainId\\username',  // Working without username and password 
      password:'password',
      options: {
          trustedConnection: true // working only with true
      }
  });
  
  await pool.connect();
  
  const request = new sql.Request(pool);
  
  const query = 'select * from table';
  
  const result = await request.query(query);
  
  console.dir(result);
  };
  main();
  </code></pre>
  <p>In the above snippet, I am able to connect without username and password but with trustedConnection true only. I am using windows authentication not SQL authentication. How can I connect using tedious js</p>