You are viewing limited content. For full access, please sign in.

Question

Question

LicenseManagerObjects.dll cannot be loaded - Add SAML user to LFDS

SDK
asked on April 12, 2022 Show version history

Here is a challenge for SDK script developers and integrators.  I have this script in a LF workflow and it successfully completes the task when I run it in the script editor: on my desktop OR on the workflow server.

However, when I run it on the workflow server within a workflow task, it fails to complete and shows the error: PMSDK Script - Add User : Could not load file or assembly 'LicenseManagerObjects, Version=11.0.2102.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' or one of its dependencies. The system cannot find the file specified.

I have added all the references required, made sure the libraries are accessible to my account (a LF_Admin account), and tested successfully on the workflow server where the references would need to succeed.

After not seeing it work, I changed the Network Service account for the workflow server processes to LF_Admin so that a domain account is used and should have access to the LFDS server through the library.

I have also registered the libraries on the workflow server.

What can I do to determine why the library is not accessible?  Is there something about the script running within a workflow activity for which I need to make more accommodations?

 

0 0

Answer

APPROVED ANSWER
replied on November 10, 2024

Hi,  added new activities to create, manage, and delete Laserfiche and SAML users and groups managed in Laserfiche Directory Server out of box on Workflow 12. 

You can see other changes from: Laserfiche 12 Changelog

Get Laserfiche Workflow 12 package from: Laserfiche 12 - Downloads

1 0

Replies

replied on April 12, 2022

Excellent!  Thank you.  That got it working.  The documentation describes something different.

1 0
replied on April 12, 2022

Glad to hear it!

Can you provide a link to said documentation? I'll look into getting it updated with clearer/corrected instructions if feasible.

0 0
replied on April 12, 2022

Do you have the LicenseManagerObjects DLL file directly in the \Program Files\Workflow (#)\ directory and the corresponding script reference pointed to that path? Try that if you haven't already.

0 0
replied on April 12, 2022

Documentation is attached.

0 0
replied on April 13, 2022 Show version history

Hrm. I see that references https://support.laserfiche.com/kb/1014149/workflow-custom-activity-setup-for-laserfiche-directory-server-sdk, but the instructions to use the subfolder didn't seem to work.

@████████ / @████████any idea what's up here?

Also general note that the LMO docs should get an update pass to include LF 11 and note compatibility with Windows Server 2022.

@████████, I'm out of office until May starting tomorrow so I unfortunately can't assist further myself in the immediate future. You should be aware that there is an "Exempt from synchronization" flag for user accounts. When you manually add a user in the LFDS Web Admin UI, this flag is automatically set. In LMO, it's the "Protected" property ("Whether or not the user object is exempt from modification by AD synchronization") of the User class, and those classes that inherit from it like SamlUser. I'm guessing that's the problem.

0 0
replied on April 13, 2022

Yes.  I observe in LFDS dbo.directory_objects.flags I have it set to 4 for the SAML user programmed addition using LMO and 20 for the user I add manually.

This would appear to be the difference.  I will wait for your return and reply for what can be done including and unsupported update to the directory_object added to change the flags to 20.

0 0
replied on April 12, 2022

Now an interesting problem.  This script runs together with HTTP posts that create an Azure AD guest user that corresponds with the LFDS users.  The overall objective is to have a guest user added to Azure that can access laserfiche using an Educational User license.  The license is assigned in the LFDS potion of the workflow but after an LFDS identity provider sync, the license assigned to the user from the scripts is removed and the user license shows None.

The license guid I used to assign an Educational user license was extracted from the LFDS database and appears to work but there is something an LFDS sync does not like about it.  All the users I add to LFDS manually when the Azure AD user is added using the automation work fine; LFDS sync DOES NOT remove the license from them.  Only the LFDS user added through the LMO library have problems.  Does the script have the right license assignment and calls or is there something missing to assign an Educational User license that will survive a sync?

0 0
replied on April 14, 2022

Is there anyone in Laserfiche who can provide a little more documentation on these properties.

  This is a very useful library for identity management integration, especially with SAML.  It is difficult to find your way through its use when these are not described. 

 

0 0
replied on June 7, 2024

@Ian Caesar, I'm reading Sam's response about C:\Program Files\Workflow (#) and I don't have that directory. Everything would be in C:\Program Files\Laserfiche\Workflow? But then Newtonsoft isn't at 13 but at 11 when it's 13 that the LicenseManagerObjects.dll needs. Where exactly did you place the files to get them to work for you? Thanks!

0 0
replied on June 7, 2024 Show version history

It appears you are using LicenseManagerObjects.dll from LF Directory Server's bin not the one from the Laserfiche SDK. That one was updated to user Newtonsoft.Json version 13 and require extra handling to load correctly.

It also looks like you are using a clean install of Workflow 11, which is why you are seeing the install path as C:\Program Files\Laserfiche\Workflow  rather than C:\Program Files\Laserfiche\Workflow (#) (older versions used the version number in the install path).

Follow these steps to get the reference to Newtonsoft.Json version 13 to load for LicenseManagerObjects:

On the Workflow server, look for the Newtonsoft subfolder in the Workflow install folder (c:\Program Files\Laserfiche\Workflow\Newtonsoft). It will have a 11.0.0.0 subfolder. Create a 13.0.0.0 subfolder right next to the 11.0.0.0. Place both LicenseManagerObjects.dll and Newtonsoft.Json.dll version 13 in this new folder. In your script, reference LicenseManagerObjects from this folder.

In the Workflow install folder, look for Laserfiche.Workflow.Service.exe.config and open it in an XML editor (Visual Studio Code or Notepad++). Look for the <probing> element under <assembly binding> (all the way at the bottom). It will look like this

<probing privatePath="RepositoryAccess;RepositoryAccess\11.0.0.0;Newtonsoft;Newtonsoft\11.0.0.0;PdfServices;PdfServices\11.0.0.0;I18n;I18n\11.0.0.0;LaserficheImaging;LaserficheImaging\11.0.0.0;HttpClient;HttpClient\11.0.0.0;DocumentServices;DocumentServices\11.0.0.0;TextProviderClient;TextProviderClient\11.0.0.0;O2SPDFRender4NET;O2SPDFRender4NET\6.1.6.3;O2SPDFView4NET;O2SPDFView4NET\6.1.6.3" />

Add the path to the 13.0.0.0 folder to it, right after Newtonsoft 11:

<probing privatePath="RepositoryAccess;RepositoryAccess\11.0.0.0;Newtonsoft;Newtonsoft\11.0.0.0;Newtonsoft\13.0.0.0;PdfServices;PdfServices\11.0.0.0;I18n;I18n\11.0.0.0;LaserficheImaging;LaserficheImaging\11.0.0.0;HttpClient;HttpClient\11.0.0.0;DocumentServices;DocumentServices\11.0.0.0;TextProviderClient;TextProviderClient\11.0.0.0;O2SPDFRender4NET;O2SPDFRender4NET\6.1.6.3;O2SPDFView4NET;O2SPDFView4NET\6.1.6.3" />

Save the file and restart the Workflow server.

If you have Workflow Designer installed on a separate machine than the server, the same steps should be applied to that machine as well. No need to restart the Workflow Server for these, just relaunch the Designer.

 

1 0
replied on June 9, 2024

When you said not part of the SDK, I was thinking what did I miss. Went back to the post and it's not part of the installation but a folder with the installer. Got that one added in the right spot, and it went through as expected.

But I did try with the newer DLL from LFDS with Newtonsoft 13 following your instructions. It still wouldn't go through, throwing the same DLL error...

6/9/2024 6:11:22 AM    Script    Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.