Git Product home page Git Product logo

Comments (11)

liamzhang40 avatar liamzhang40 commented on July 24, 2024 1

sorry for the noob comment, but is there a way to rely on the tedious connection for this? i can connect to MSSQL using windows authentication with tedious using this connection config

var Connection = require('tedious').Connection
var config = {
  server: 'SERVER',
  authentication: {
    type: 'ntlm',
    options: {
      domain: 'DOMAIN',
      userName: 'USER',
      password: 'PASS'
    }
  },
  options: {
    encrypt: true,
    database: 'DB_NAME'
  }
}
var connection = new Connection(config)
const config = {
  host: process.env.DB_SERVER,
  dialect: 'mssql',
  dialectOptions: {
    authentication: {
      type: 'ntlm',
      options: {
        domain: process.env.DB_DOMAIN,
        userName: process.env.DB_USERNAME,
        password: process.env.DB_PASSWORD,
      },
    },
    options: {
      instanceName: process.env.DB_INSTANCE,
    }
  },
};

const sequelize = new Sequelize(
  process.env.DB_NAME,
  null,
  null,
  config,
);

As per well-hidden here, https://github.com/vishwasjois/sequelize/blob/988e754c6eef323b1a9dc11f5bee3fb535579da8/docs/upgrade-to-v5.md#dialect-specific

from website.

 avatar commented on July 24, 2024 1

sorry for the noob comment, but is there a way to rely on the tedious connection for this? i can connect to MSSQL using windows authentication with tedious using this connection config

var Connection = require('tedious').Connection
var config = {
  server: 'SERVER',
  authentication: {
    type: 'ntlm',
    options: {
      domain: 'DOMAIN',
      userName: 'USER',
      password: 'PASS'
    }
  },
  options: {
    encrypt: true,
    database: 'DB_NAME'
  }
}
var connection = new Connection(config)
const config = {
  host: process.env.DB_SERVER,
  dialect: 'mssql',
  dialectOptions: {
    authentication: {
      type: 'ntlm',
      options: {
        domain: process.env.DB_DOMAIN,
        userName: process.env.DB_USERNAME,
        password: process.env.DB_PASSWORD,
      },
    },
    options: {
      instanceName: process.env.DB_INSTANCE,
    }
  },
};

const sequelize = new Sequelize(
  process.env.DB_NAME,
  null,
  null,
  config,
);

As per well-hidden here, https://github.com/vishwasjois/sequelize/blob/988e754c6eef323b1a9dc11f5bee3fb535579da8/docs/upgrade-to-v5.md#dialect-specific

You are an excellent human. I've been searching for a way to configure this for such a long time. Thank you so much!

from website.

papb avatar papb commented on July 24, 2024

Do you have any idea on how this could be implemented? Pull requests are welcome!

from website.

zeagord avatar zeagord commented on July 24, 2024

I honestly don't know how to do it. But can take a look and see how this can be done.

from website.

papb avatar papb commented on July 24, 2024

Anything that you can find helps! Thanks!

from website.

chupacabra71 avatar chupacabra71 commented on July 24, 2024

sorry for the noob comment, but is there a way to rely on the tedious connection for this? i can connect to MSSQL using windows authentication with tedious using this connection config

var Connection = require('tedious').Connection
var config = {
  server: 'SERVER',
  authentication: {
    type: 'ntlm',
    options: {
      domain: 'DOMAIN',
      userName: 'USER',
      password: 'PASS'
    }
  },
  options: {
    encrypt: true,
    database: 'DB_NAME'
  }
}
var connection = new Connection(config)

from website.

chupacabra71 avatar chupacabra71 commented on July 24, 2024

well-hidden indeed. Thank you!

from website.

papb avatar papb commented on July 24, 2024

I hoped it wouldn't be this hard to find...

So, happy to know there is a way, I will leave this open as a docs issue so that we show how to do it somewhere. Thanks everyone!

from website.

troyfitzwater avatar troyfitzwater commented on July 24, 2024

I'm pretty new to using ORMs and db drivers with node, but would I still need to use a username and password if I'm doing Windows Authentication?

I've been using msnodesqlv8 to connect with Windows Authentication through trusted_connection but I need to use a Linux environment now.

from website.

elierrgm avatar elierrgm commented on July 24, 2024

@troyfitzwater were you able to find how to use Windows Authentication (or an alternative, I do not think you can use Windows Authentication in linux) through trusted connection (not having to provide the password) in Linux?

from website.

github-actions avatar github-actions commented on July 24, 2024

This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

from website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.