IIS -Imitation funktioniert nicht, wenn der App -Pool mit Domain -Konto ausgeführt wirdC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 IIS -Imitation funktioniert nicht, wenn der App -Pool mit Domain -Konto ausgeführt wird

Post by Anonymous »

Ich habe eine ASP.NET -Anwendung in einer Windows -Intranet -Umgebung. Ich habe die Anforderung, bestimmte Datenbankaktualisierungen als als derzeit angemeldete in Benutzer durchzuführen. < /p>

IIS /Server Info: < /p>
  • IIS Version 10 < /> Windows Server 2019 < /li>
    asp.net -Web -Forms -Anwendung < /li>
    .NET 4.7 < /li> < /li>
    < Authentifizierung aktiviert
  • Imitation und Anonyme Authentifizierung sind deaktiviert.
Other details:
  • All of my database connection strings are set such that integrated security=true
  • in active directory, have configured constrained delegation between the web server and the SQL server, allowing MSSQLSvc : 1433 and MSSQLSvc (no port)
  • The domain service account is a member of the local administrators group on the web server (for testing purposes only)
When i perform the database updates that need to Als der derzeit angemeldete Benutzer erledigt werden, habe ich sie auf diese Weise ausgeben: < /p>

Code: Select all

 var windowsIdentity = User.Identity as WindowsIdentity;
WindowsIdentity.RunImpersonated(windowsIdentity.AccessToken, () =>
{
// perform database update
});
< /code>

Dies bringt eine Ausnahme aus -
System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'


Wenn ich die App -Pool -Identität ändere, um AppPoolIdentity (die Standard -App -Pool -Identität) zu verwenden, funktioniert die Impotation richtig.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post