Error "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication." in SQL server


I was trying to run my amazon RDS account using MS SQL server management studio, and was able to login succesfully but when using that values in web.config and loading page in browser, I am getting error as below

"Login failed. The login is from an untrusted domain and cannot be used with Windows authentication."

How Can I resolve this issue, here is my Connection string

    <add name="DefaultConnection" connectionString="data source=DataSOurce;initial catalog=Demo;persist security info=True;user id=dbname;password=password;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />

    <add name="DemoEntities" connectionString="metadata=res://*/Models.DemoDBModels.csdl|res://*/Models.DemoDBModels.ssdl|res://*/Models.DemoDBModels.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DataSOurce;initial catalog=Demo;integrated security=True; user id=dbname;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Thanks


Asked by:- Vinnu
0
: 3028 At:- 2/27/2019 10:25:13 AM
SQL SQL-Server







1 Answers
profileImage Answered by:- vikas_jk

In your DemoEntities Connection string, you should remove Integrated Security=true to make it work.

Integrated security means simply - use your windows credentials for login verification to SQL Server, so as you have mentioned you are trying to connect to different domain rds account, it will fail, you can make your

IntegratedSecurity = false; 

or remove Integrated Security=true, once you do this SQL Server will use the SQL Server login and password provided in your connection string.

1
At:- 3/3/2019 3:18:27 PM
It works as needed, thank you 0
By : Vinnu - at :- 4/6/2019 7:58:47 AM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use