Last post Nov 22, 2013 07:52 AM by martinwang1985
Nov 20, 2013 10:04 AM|martinwang1985|LINK
may i ask a question.i log in windows with username "DOMANI\martin".and i have a web project.when i debug it in local host ,i found when i use connection string of database "integrated Security=SSPI",the user name is "martin"
but when i publish this web project on a server(the name,"server-deploy"),then i found that when i use a connection string of database "integrated Security=SSPI",it became "DOMANI\server-deploy"
could anyone help me to resolve this problem? thank u very much in advance for ur kindness help
Nov 20, 2013 11:00 AMemail@example.com|LINK
That's as expected. You will need to run the app pool under the account you want to use if using integrated security. On the dev server, it runs as the logged in user. On the deployment server, it runs as the app pool account.
Nov 20, 2013 11:09 AM|martinwang1985|LINK
thank u very much for ur reply
but how can i avoid this? that is to say,i would like that in deploy server,when "integrated Security=SSPI",is it possible the user is not ser but the logged window user?thank u very much
Nov 21, 2013 02:34 AM|Starain chen - MSFT|LINK
Thanks for your post!
In my opinion, I think the user that the database used is who logged on the
About change the log type of website, you can try follow these steps below:
1. Right click the Application pool that the website used and select Adavanced Settings
2. Find the Identity in the Process Model section.
3. Modify the value to LocalSystem.
On the other hand, if you want get the logged user in the code, I think you should enable
IIS basic authentication/IIS digest authentication/IIS integrated Windows, for more information, please refer to:
There is a link that may benefit you:
# Configure Windows Authentication
Nov 21, 2013 04:17 AM|martinwang1985|LINK
thank u very much for ur kindness reply
welli folloewed ur suggestion
Process Model section-> LocalSystem.
and ""Windows autentication"
but stil doesnt work
could u help me again?
thank u very much
Nov 21, 2013 04:22 AM|martinwang1985|LINK
may i explain more detail my situation
i log in windows with username "DOMAIN\martin".and i have a web project.when i debug it in local host ,i found when i use connection string of database "integrated Security=SSPI",the user name is "DOMAIN\martin" <div class="comment-right-col"> <div>
but when i publish this web project on a server(the name,"server-deploy"),then i found that when i use a connection string of database "integrated Security=SSPI" or "Trusted_Connection=Yes",with web config file <authentication mode="Windows" />
but i was told error Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.is it possible that when connect with database the user is "DOMAIN\martin"?
thank u very much again
Nov 22, 2013 12:53 AM|Tear09|LINK
i publish this web project on a server
is it possible that when connect with database the user is "DOMAIN\martin"?
What the user account that you logged on the server machine?
It will use the current user account. For example, DOMAIN\martin logged on the server machine, it will use the DOMAIN\martin account.
Using the SQL authentication is the better way.
BTW: How do you know the account that connect to the database. Do youu use the SQL Server Profiler?
Nov 22, 2013 06:34 AM|martinwang1985|LINK
thank u very much for ur reply
i have enabled Kerberos on IIS7 and it works
Nov 22, 2013 07:02 AM|PatriceSc|LINK
Try to add <identity impersonate="true" /> in your web.config file. See
http://msdn.microsoft.com/en-us/library/aa292118(v=vs.71).aspx for details.
Note that this is to be done only if it is required by the application design: "Impersonation can significantly affect performance and scaling. It is generally more expensive to impersonate a client on a call than to make the call directly."
It's expected on your dev box as the web server runs under the current Windows account rather than under a predefined account...
Nov 22, 2013 07:52 AM|martinwang1985|LINK
thank u very much . i added add <identity impersonate="true" /> and set enable of delegation and it works