Note that there are some explanatory texts on larger screens.

plurals
  1. POweb app losing credentials when calling database
    primarykey
    data
    text
    <p>I have a Web server and a separate database server. This is an internal web page only so is not on an external DMZ. IIS Settings for the web site authentication are Anonymous Disables, ASP.Net enabled, forms disabled, windows enabled.</p> <p>If I get the current user name using the below code on the web page it renders correctly from the client machine:</p> <pre><code>lblUserName.Text = System.Web.HttpContext.Current.User.Identity.Name.ToString() </code></pre> <p>When I run the web site locally on the web server the database connection works perfectly, but when I run from the client machine for some reason it loses the current user and tries to use anonymous credentials to connect rather than passing through the current windows credentials. The error message presented is: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (when making the DB connection).</p> <p>My DB connection string is set in web.config and has Integrated Security="SSPI". In my web.config I also have authentication mode="windows" and identity impersonate = "true".</p> <p>Not sure if it makes a difference (I am not great at IIS, having usually had someone else in the company deal with this, and where I am now there is no-one who really seems to know what they are doing with IIS) but in IIS on the App Pool I have the advanced settings process model identity set to 'ApplicationPoolIdentity' and load user profile set to True. I have also tried, on advice from Tim (thank you), using a known used instead of the ApplicationPoolIdentity, and have entered the credentials used to run the SSRS reports so I know they have the right permissions, but still get the same error.</p> <p>Am I missing something really obvious in IIS or in the web.config which is needed to pass through the current user credentials?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload