I am working on a web service that will return matches of images based on windows authentication of the user and what they have access to. I am using the WebDocView application example from the ACI351 class as an example of how to impersonate a user with a windows service.
Upon using session.Login(repositoryreg), I get the following error:
Could not load file or assembly 'Laserfiche.HttpClient, Version=9.0.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
I verified that the Current User Identity is correct. The relevant piece of my code is as follows:
try { var current = System.Security.Principal.WindowsIdentity.GetCurrent(); WindowsIdentity clientID = (WindowsIdentity)HttpContext.Current.User.Identity; using (wic = clientID.Impersonate()) { // Log into Repository RepositoryRegistration MyRepository = new RepositoryRegistration(servername, reponame); Session newsession = new Session(); newsession.LogIn(MyRepository); MySession = newsession; } } catch (Exception e) { error = e.Message; }
If anyone has any ideas on what I am missing here, I'd greatly appreciate it.
Thanks!
Jonathan