Craig Gibbons' Lifeblog lifeblog://


ASP.NET error when impersonating a user

Lately I have been developing a small application which is essentially the same as Windows Explorer. The idea is that business units within the company I work for, can publish documentation easily by giving a single user access to a given filepath, which I then impersonate when making calls to the file system in my application. Since I started developing the application, I have come up against numerous perplexing problems which have all had something to do with Windows or .NET security in one way or another. The latest one I came up against is as follows:

"Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied."

I blog it here because I was unable to find any useful information on this error anywhere and only managed to solve it by making a lucky (if educated) guess. The solution to this problem was to give the ASPNET account "Impersonate a client after authentication" rights on the machine the application is running on. For some reason, a reboot was not required in this case. You can find this setting by going to Control Panel -> Administrative Tools -> Local Security Policy, then expand Local Policies and select User Rights Assignment. Note that it will probably also be necessary to assign the "Act as part of the operating system" right to the ASPNET account, although you probably would not have gotten to this error before doing that in any case.

Filed under: Tech Leave a comment
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.