Our asp.net application needs to put a created file in a folder. A service account was created for this purpose. So, right before the application writes to a folder, I wanted to do the impersonation. But I get the error Logon failure : the user has not been granted the requested logon type at this computer. Any ideas?
It happens both running the application from devenv and once published.
This is how I call the impersonation
using (new Demo.Impersonation(userName, domain, password))
{
}
This is the class I use for impersonation
using System;
using System.ComponentModel;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Principal;
namespace Demo
{
public enum LogonProvider
{
Default = 0,
}
public enum LogonType
{
Interactive = 2,
...
Go to the complete details ...