by Anonymous » 22 May 2025, 22:07
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.>
Ich habe eine ASP.NET -Anwendung in einer Windows -Intranet -Umgebung. Ich habe die Anforderung, bestimmte Datenbankaktualisierungen als [b] als derzeit angemeldete in Benutzer [/b] durchzuführen. < /p>
IIS /Server Info: < /p>
[list]
[*] IIS Version 10 < /> Windows Server 2019 < /li>
asp.net -Web -Forms -Anwendung < /li>
.NET 4.7 < /li> < /li>
< Authentifizierung aktiviert
[*] [b] Imitation [/b] und [b] Anonyme Authentifizierung [/b] sind deaktiviert.
[/list]
Other details:
[list]
[*]All of my database connection strings are set such that [b]integrated security=true[/b]
[*]in active directory, have configured constrained delegation between the web server and the SQL server, allowing [b]MSSQLSvc : 1433[/b] and [b]MSSQLSvc (no port)[/b]
[*]The [b]domain service account[/b] is a member of the local administrators group on the web server (for testing purposes only)
[/list]
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] 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'[/code]
Wenn ich die App -Pool -Identität ändere, um [b] AppPoolIdentity [/b] (die Standard -App -Pool -Identität) zu verwenden, funktioniert die Impotation richtig.>