0

I am having a problem connecting to my Database (which is on a different location) via my MVC application.

To test the DB connection, I made a Windows Form Application and used it to connect to the database with the same connection string which I am using in my MVC app

Server=192.168.16.243; Database=Precision_DB;Trusted_Connection=True;

The Windows form application connects and retrieves data perfectly, but the MVC app is giving me the following error:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
[SqlException (0x80131904): Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.]

I should mention that I am using NHibernate in my MVC app. Does that make a difference? how can I resolve this issue.

Please help

progrAmmar
  • 2,606
  • 4
  • 29
  • 58

1 Answers1

0

If you intend to use integrated security you need to turn impersonation on:

<identity impersonate="true" />

Otherwise add username and password to the connection string:

Data Source=myServerAddress;Initial Catalog=myDataBase;User ID=xxx;Password=yyy;

reference :

Critics of anonymous login claim that they can reduce overall Internet and network security because a secure authentication process is not part of the anonymous login process. In addition, user-specific pre-establishments are absent during anonymous logins, leaving critics warning that such logins might not be as anonymous as users would like because servers and IP addresses can be revealed.

Community
  • 1
  • 1
Arunprasanth K V
  • 20,733
  • 8
  • 41
  • 71
  • I am using Trusted Security to connect to the database. Is it good practice to give Anonymous user access to the DB? – progrAmmar Jan 13 '15 at 06:48