Search code examples
asp.net-coreasp.net-core-2.0sqlconnection

Disable Windows Authentication while connecting into database


I have the problem with connection into database with asp.net core 2.0.

There is my connection string :

  "ApplicationConfiguration": {
    "DefaultConnection": "Server=***; Database=***; User Id=***; Password=***; Trusted_Connection=True; Integrated Security=True;"
  }

I'm getting connection string properly so it's not an issue. :( In the database I have mixed authentication. So whenever I'm connect to database it's using props from connection string and using Windows Authentication as well. Why I know that ? Because on my pc It's work fine because I'm 'registered' to database. But whenever my friend trying to connect into database he gets "Login failed" error but his domain Login is displayed not from connection string.


Solution

  • SOLUTION :

    Just remove from your connection string:

    Trusted_Connection=True; Integrated Security=True;
    

    Thanks to : Schadensbegrenzer Explanation : When using Trusted_Connection=true and SQL Server authentication, will this effect performance?