I'm having a heck of a time trying to figure out why I can not authenticate Windows Users with my code when I am able to login with the 9.1 Client just fine. I am using the RA library.
Question
Question
Are there any known issues with using sdk 9.2 and connecting to a 9.1 server?
Answer
LocalSystem does not actually mean the currently logged in user. It's a special system account that really is only local to that specific machine. If you were trying to do anything that involved authenticating to a remote machine, local system will never be granted access, since the remote machine will have no knowledge of it.
Replies
Instead of loging into the repository, you should get the session from the Workflow.
See How to get current session from a SDK Script in Workflow
Would you mind pointing me towards Workflow documentation? Is Workflow a separate product?
Sorry, I quickly looked at your code block and saw the class was LFWorkFlow and jumped to the conclusion that you were working on an actual WorkFlow script.
There shouldn't be issues, but does it matter if you try using RA 9.1 instead of RA 9.2? Both are present in the SDK 9.2 package.
I'm using RA 9.2. I tried to go back to 9.1 and got the same error.
We'd probably need a code snippet then to see what's going on. I assume this is from the same machine where the Client is working?
Yes. Two vm's. One client and one server. I'm not sure what code would be of use to you.
LFSession.LogIn(username, password, LFRepository); // works with LF admin account LFSession.LogIn(LFRepository); // does not work
Error I receive: Access denied. [9013]Laserfiche login failed.
EDIT: I have tried using my account as a fully named user and without be a named user. I've tried logging in with someone else's account and received the same error. I've tried using the server name and the server ip with no luck.
EDIT: more code:
public Session LFSession = new Session(); public RepositoryRegistration LFRepository = new RepositoryRegistration(serverName, repoName);
Is this a Win Forms app, or something else? Can you post enough code or give enough context that it's possible for someone else to reproduce this problem?
It's a service.
public class LFWorkflow { public static string serverName = "sName", repoName = "rName"; private static string username = "admin", password = "********"; public Session LFSession = new Session(); public RepositoryRegistration LFRepository = new RepositoryRegistration(serverName, repoName); private bool LoggedIn = false; public string WFStatus; //Primary execution for the LFWorkflow class. public void Start() { try { WFStatus = DateTime.Now.ToString() + ": New LFWorkflow class started." + Environment.NewLine; try { //LFSession.LogIn(username, password, LFRepository); LFSession.LogIn(LFRepository); // no access with win credentials LoggedIn = true; } catch (LaserficheRepositoryException ex) { WFStatus += "Login failure (RA):" + ex.Message; } catch (Exception ex) { WFStatus += "Login failure:" + ex.Message; } if (LoggedIn) { WFStatus += "Successfully logged in to Laserfiche repository: " + LFSession.Repository.Name + " on server: " + LFSession.Repository.ServerName + Environment.NewLine; WFStatus += "Port: " + LFSession.Repository.Port + ". Secure Port: " + LFSession.Repository.SecurePort + Environment.NewLine; } else { WFStatus += "Laserfiche login failed." + Environment.NewLine; } } catch (LaserficheRepositoryException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { try { LFSession.Close(); WFStatus += "Laserfiche connection terminated." + Environment.NewLine; } catch (Exception) { } } }
And you've configured the service to run as an account that has permission to log in to your Laserfiche repository?
I believe this is the problem. I was able to login with my Win credentials using a WinApp. Any info on configuring the service to run as the right account?
I was able to get it working by changing the log on option accessed in my service's properties. Although I'm not sure if this will help me in the long run. I unchecked Local System account and browsed for my account, but those should be the same accounts.
LocalSystem does not actually mean the currently logged in user. It's a special system account that really is only local to that specific machine. If you were trying to do anything that involved authenticating to a remote machine, local system will never be granted access, since the remote machine will have no knowledge of it.
Thanks!