J
Julie
Hi all,
I have an ASP .NET application and am experiencing an interesting issue.
The application runs under Windows integrated authentication and anonymous
access is turned off; I need the current logged in user's ID for some initial
processing. Partway through the code, I impersonate a system account using
WindowsIdentity objects with the objective of retrieving a file from another
server.
I have the username and password for the system account encrypted in my
code. I can verify using Environment.Username that the impersonation is
working - the username of my system account is returned. However, I'm unable
to authenticate to the file server. It doesn't seem to me that this is a
"double-hop" as I'm just hopping from my web server to this file server - I
do not need to pass the logged-in user's credentials to the file server, just
this system account's credentials that I configure from within my code. (And
unfortunately I cannot make changes to the file system security.)
Any feedback as to whether this is possible would be appreciated. If
necessary, I can switch to moving the service account's credentials to the
web.config file in the <impersonate> tag but I'm hoping there's a way to
switch between the user accounts in the same application.
Thanks!
I have an ASP .NET application and am experiencing an interesting issue.
The application runs under Windows integrated authentication and anonymous
access is turned off; I need the current logged in user's ID for some initial
processing. Partway through the code, I impersonate a system account using
WindowsIdentity objects with the objective of retrieving a file from another
server.
I have the username and password for the system account encrypted in my
code. I can verify using Environment.Username that the impersonation is
working - the username of my system account is returned. However, I'm unable
to authenticate to the file server. It doesn't seem to me that this is a
"double-hop" as I'm just hopping from my web server to this file server - I
do not need to pass the logged-in user's credentials to the file server, just
this system account's credentials that I configure from within my code. (And
unfortunately I cannot make changes to the file system security.)
Any feedback as to whether this is possible would be appreciated. If
necessary, I can switch to moving the service account's credentials to the
web.config file in the <impersonate> tag but I'm hoping there's a way to
switch between the user accounts in the same application.
Thanks!