Last post Jul 15, 2019 11:47 AM by PatriceSc
Jul 14, 2019 09:09 AMemail@example.com|LINK
I'm using Core 2.1 and Sql Server 2008.
I'm trying to connect to a server with public IP on internet using Srartup.cs connection like this:
var connection = @"Data Source=MyIp\DBMAIN;User id=MyUser;password=MyPassword;Integrated Security=False;Database=Pri;Trusted_Connection=True;ConnectRetryCount=0";
I'm using Core Identitiy with the project. when I try to log in it gives me this error:
SqlException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
Why? and How ro solve please?
Jul 15, 2019 02:50 AM|Yang Shen|LINK
This problem may be due to the incorrect server authentication method used by your database server.
If this case, you can try to right-click your server in SQL--select
properties, and check the server authentication as “SQL Server and Windows Authentication Mode” in the
Or you can try to delete "Integrated Security = False;".
You can refer to:
Untrusted domain .
Jul 15, 2019 07:35 AMfirstname.lastname@example.org|LINK
The server authentication property is already set to
SQL Server and Windows Authentication Mode.
Also I deleted "Integrated Security = False;" but the same error appears!
Jul 15, 2019 07:42 AM|PatriceSc|LINK
Delete also Trusted_Connection=True which is to enable Windows authentication (Integrated Security being another keyword)
Jul 15, 2019 10:56 AMemail@example.com|LINK
Thanks. It is working now fine.
but deleting this one does make this connection not secure?
Jul 15, 2019 11:47 AM|PatriceSc|LINK
It enables Windows authentication (ie using the IIS side account to connect to SQL Server). The other option would be to have a trust accross domains as pointed by the error message. If so concerned with security how does it come you exposed your database
server with a public IP which is unusual ?
If you are currently just fixing things so that they work the way it is maybe should you start by seeing how you want things to work and make them work this way ?