Ubuntu 22.04
Wine 8.0.2 - 32-bit prefix
Installed using winetricks
.NET 4.6.2
gdiplus
mdac28
I have winbind 4.15.13 installed. I am able to login to Ubuntu using my Windows domain account credentials.
I have a simple .NET Winforms Application which connects to a Microsoft SQL server and returns the date and time. I can choose to connect to SQL server by 'SQL Server Authentication' or by 'Windows Authentication'.
I am able to connect and retrieve date/time from the SQL server using a connection string that uses 'SQL Server Auth'.
"Connection Timeout=10;Data Source=MYSERVER;Initial Catalog=MyCat;Persist Security Info=True;Integrated Security=False;User ID=User;Password=MyPasswd"
I am NOT able to connect using a connection string that uses 'Windows Auth'.
"Connection Timeout=10;Data Source=MYSERVER;Initial Catalog=MyCat;Persist Security Info=True;Integrated Security=True"
The Test.exe app works as expected on a Windows 10 computer, but under wine I receive the following error.
My test app has a try/catch that outputs the followingWINEDEBUG=fixme-olepicture wine Test.exe
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 10003159, 28) stub
0024:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 014005ED, 28) stub
0024:fixme:heap:GetNumaHighestNodeNumber semi-stub: 0021FC50
0024:fixme:seh:WerRegisterRuntimeExceptionModule (L"C:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscordacwks.dll", 013F0000) stub
010c:err:ole:CoGetContextToken apartment not initialised
0024:fixme:nls:get_dummy_preferred_ui_language (0x8 0x409 0021E694 00000000 0021E690) returning a dummy value (current locale)
0024:fixme:nls:get_dummy_preferred_ui_language (0x8 0x409 0021E694 00485F30 0021E690) returning a dummy value (current locale)
0024:fixme:nls:LCMapStringEx unsupported lparam 486248
0024:fixme:win:DisableProcessWindowsGhosting : stub
0068:fixme:imm:ImeSetActiveContext (00010026, 0): stub
0068:fixme:imm:ImmReleaseContext (00010020, 00010026): stub
0024:fixme:imm:ImeSetActiveContext (00020048, 1): stub
0024:fixme:imm:ImmReleaseContext (00010070, 00020048): stub
0024:fixme:ver:GetCurrentPackageId (0021BA48 00000000): stub
0024:err:ntdll:NtQueryInformationToken Unhandled token information class 11
011c:fixme:virtual:NtFlushProcessWriteBuffers stub
I understand that when using 'Integrated Security' that the login credentials sent to SQL server are gotten from the operating system. I think the problem is in System.Data.* and that wine cannot get the domain user/password credentials from Ubuntu.System.Runtime.InteropServices.COMException (0x80070001): Invalid function. (Exception from HRESULT: 0x80070001)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Win32NativeMethods.IsTokenRestrictedWrapper(IntPtr token)
at System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrent()
at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Test.Form1.C1Button1_Click(Object sender, EventArgs e)
Has anyone successfully used Windows Authentication to login into a MS SQL server?
Thank you,