Community
Showing results for 
Search instead for 
Do you mean 
Reply

Integration with an ASP.NET Web application

New Member
Posts: 2
Country: Australia

Integration with an ASP.NET Web application

Hi,

 

Little bit of background info - I'm working on a licensing system for our software, it captures stuff like expiries, upgrade and support contracts, and a whole host of other information pertaining to our customers

 

What I wanted to do was link the web app with all of our contacts in our ACT! database. So I worked on some integration code, and utilise an instance of ActFramework and can query/listContacts,and associated data.

 

However it all went down the toilet when it came to deploying it under IIS

 

IIS runs under the NETWORK SERVICE account, which does not have a windows profile.. It would seem that when attempting to log on to the ACT! framework that there is an assumption being made that the calling code is executing under credentials with a windows profile.. I basically end up with access violation exception with the error message "Access to the path 'ACT\ACT For Windows 11\Preferences' is denied." (Because it doesn't exist)

 

Anything I can do to get this working (Really desperate)

 

Regards,

 

Sean

New Member
Posts: 2
Country: Australia

Re: Integration with an ASP.NET Web application

I've implemented a work around for the tim ebeing - Basically before I call ActFramework::LogOn, I create a windows impersonation context with the credentials of a well known domain account (my own), and then calls to the framework happen with my credentials rather than the IUSR account

 

 

 

.....

 

var accessToken = IntPtr.Zero; if (!LogonUser("user", "domain", "password", LOGON_TYPE_INTERACTIVE, LOGON_TYPE_PROVIDER_DEFAULT, ref accessToken)) { throw new ApplicationException("Error authenticating"); } var identity = new WindowsIdentity(accessToken); var context = identity.Impersonate(); var framework = new ActFramework(); try { framework.LogOn(username, password, "SERVER", "DB"); ... do framework stuff } finally { framework.LogOff(); context.Undo(); }

...... Implementation of LogonUser: private const int LOGON_TYPE_INTERACTIVE = 2; private const int LOGON_TYPE_PROVIDER_DEFAULT = 0; [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)] static public extern bool LogonUser(string userName, string domain, string passWord, int logonType, int logonProvider, ref IntPtr accessToken);

 

 It's not the best solution, but it keeps me moving forward, hope it helps someone else