I have to connect with mssql database using window authentication where I am using Nodejs and msnodesqlv8. I followed How to connect to SQL Server with windows authentication from Node.JS using mssql module to do the setup code but as it's window authentication so no username/password required but after writing code connection using above link
const sql = require("mssql/msnodesqlv8");
const conn = new sql.ConnectionPool({
database: "db_name",
server: "server_name",
driver: "msnodesqlv8",
options: {
trustedConnection: true
}
});
conn.connect().then(() => {
// ... sproc call, error catching, etc
// example: https://github.com/patriksimek/node-mssql#request
});
I am getting this error ConnectionError: Login failed for user '', I tried a lot of links to understand the root cause but I am unable to understand also I am working on Mac M1, Azure data studio where manually I am not able to connect to database using window authentication as I am getting error 'Connection failed due to Kerberos error' so is this the cause, please help me to understand the issue.