microsoft / mssql-scripter

Repository for the new SQL cross-platform command line tools
Other
739 stars 147 forks source link

How to connect when connection requires specifying a 'domain' connection property #260

Open nneul opened 3 years ago

nneul commented 3 years ago

When using JDBC client for MSSQL, in order to successfully authenticate as a domain user from a non-domain system (in particular using dbeaver client which uses 'Microsoft JDBC Driver for SQL Server' -- I have to add a connection property of "domain=my.domain.com", and authenticate as just the plain userid and password with "NTLM" chosen as the authentication scheme. No combination of using DOMAIN\userid or userid@domain or similar will function otherwise.

Is there some way to do something similar to this with mssql-scripter? It just gets a fairly generic login failed with every combination I've tried.

Error details:

Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server SERVER. ---> System.Data.SqlClient.SqlException: Login failed for user 'USERID'.
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)

To my knowledge the SQL server installation is a fairly vanilla install with AD integrated authentication. I am attempting to authenticate with an AD userid in the same domain as the database server.

KevinBott commented 2 years ago

@nneul Did you have any luck getting connected? I'm also trying to use NTLM authentication scheme.

nneul commented 2 years ago

@kevinbott No, never did get anywhere on this.

fpauser commented 1 year ago

Any news on this? Would be helpful being able to connect using NTLM...

KevinBott commented 1 year ago

@fpauser No news. I'm not hopeful that it will be supported unless someone from the community figures it out. Major updates to the dev branch (from key contributors) stopped in mid-2018.

fpauser commented 1 year ago

@KevinBott Thanks for pointing out.