i still get error ” Login failed for user ” .
i want to connect with sql data
i write this code in app.module
import { Module } from '@nestjs/common';
import { SequelizeModule } from '@nestjs/sequelize';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { User } from './users/users.model';
import { UsersModule } from './users/users.module';
import { AuthModule } from './auth/auth.module';
@Module({
imports: [
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'uploads'), // Path to the folder where your files are uploaded
serveRoot: '/uploads', // Route at which the files are served
}),
SequelizeModule.forRoot({
dialect: 'mssql',
host: 'sql ip', // Your SQL Server host
port: sql port, // Your SQL Server port
username: '', // Leave empty if using Windows Authentication
password: '', // Leave empty if using Windows Authentication
database: 'NEWDCC-v3', // Your SQL Server database name
dialectOptions: {
options: {
encrypt: true, // Set to true if SQL Server requires encryption
trustServerCertificate: true, // Use this if your SQL Server uses self-signed certificates
// This will tell Sequelize to use Windows Authentication
authentication: {
type: 'ntlm', // NTLM authentication
options: {
domain: 'ldap domin', // Replace with your AD domain
userName: 'my user name', // LDAP username
password: 'my password ', // LDAP password
},
},
},
},
models: [
User,
],
autoLoadModels: true,
synchronize: true,
logging: (msg) => console.log(msg),
}),
UsersModule,AuthModule
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule { }
and did Linux Server Configuration :
Install LDAP Client Packages:
Install necessary LDAP client packages on your Linux server:
sudo apt update
sudo apt install ldap-utils libnss-ldap