Creation of Custom APIs

Hi,

Following the documentation: 

https://support.oneidentity.com/technical-documents/identity-manager/9.1/api-development-guide/7#TOPIC-1874743 

 

  1. Create an API plugin 

Only discrepancy with the documentation in point two, after opening visual studio, 

we created the project as a Class Library (.NET Framework) based on the guide to the guide to version 4.8, there is no direct .NET Framework 4.8 project as indicated by the guide 

 

We called our project: 

CCC.Test.CompositionApi.Server.Plugin 

 

Wrote the following api, as shown in the installation file examples 

 

using QBM.CompositionApi.Crud; 
using QBM.CompositionApi.Definition; 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 

  

namespace CCC.Test.CompositionApi.Server.Plugin 
{ 
    public class ViewPersonPersonNoIag : IApiProvider 
    { 
        public void Build(IApiBuilder builder) { 
            builder.AddMethod(Method 

  

                // Set the method URL. 
                .Define("viewallperson") 
                // Set the database table 
                .FromTable("CCC_View_PersonIAGSI_IAGNO") 
                .EnableRead() 

  

                // This will include all enabled columns in the result 
                .WithAllColumns()); 
        } 

  

  

    } 
} 

Proceeding, still following the documentation, to build and obtain the dll, which we imported via Software Loader into OneIdentity. However, when we restart the server we cannot find the installed file. What are we doing wrong?

  • Hello Gaetano,

    There are a few things to look for:

    When uploading the DLL file with Software Loader, did you assign the file to the correct machine role? (API Server)

    Did you upload the file with a "bin\" path prefix so that it gets deployed to the bin folder?

    Is software update disabled on the server? Check the API Server logs to see the update status.

    Thanks,

    Hanno

  • Hi Hanno,
    Thank you for your answer.


    Yes, we are assigning the machine role as per the documentation.
    Again as indicated, we loaded the file into the /bin subfolder.


    - C:\Program Files\One Identity\One Identity Manager\bin\CCC.Test.CompositionApi.Server.Plugin.dll in Business Api Server

    Is the path correct?

    (we also tried to reload the dll as DevelopmentAndTesting but we are unable to assign the machine role to it as the version already loaded exists)

    Windows updates status is disabled.

    Is it correct to create the plugin as a Class Library (.NET Framework)?

    Thank you,

    Gaetano

  • I would add that we have correctly extended the portal provider, differently from what is present in the code, as follows:

    IApiProviderFor<QER.CompositionApi.Portal.PortalApiProject>

    it's correct?

  • Hello Gaetano,

    The signature IApiProviderFor<QER.CompositionApi.Portal.PortalApiProject> is correct to add the API to the "portal" API project.

    The selected .NET Framework version is also correct.

    Please try adding the solution from this post:

    www.oneidentity.com/.../83292

  • Hello Hanno,

    I've added [assembly: QBM.CompositionApi.PlugIns.Module("CCC")] in AssemblyInfo file and I compile a new dll named "CCCcustomapi.CompositionApi.Server.PlugIn.dll".

    I put this file in folder C:\inetpub\wwwroot\ApiServer\bin\imxweb\custom and I import it into database via Software Loader selecting Business API Server machine role.

    Then I copy this file in C:\Program Files\One Identity\One Identity Manager\bin and I import it into database via Software Loader selecting DevelopmentAndTesting machine role.

    Then I launch "iisreset" command for Api Server Reset but I can't see my file CCCcustomapi.CompositionApi.Server.PlugIn.dll in the bin folder of ApiServer. From "Api Development Guide": 

    "Restart the API Server and ensure that the <project name>.CompositionApi.Server.Plugin file exists in the bin folder of the API Server install directory."

    There is something wrong?

    If I launch command imxclient compile-api /copyapi imx-api-ccc.tgz /packagename imx-api-ccc I can't see my method in result package imx-api-ccc.tgz

    What do you suggest?

  • The bin folder referred to is the bin folder of the API server installation (C:\inetpub\wwwroot\ApiServer\bin\), see your web server. Check in the table QBMFileRevision if the value of the column FileName@QBMFileRevision is equal to bin\CCC.Test.CompositionApi.Server.Plugin.dll. You can load the same file from your directory C:\Program Files\One Identity\One Identity Manager\ with the Development and Testing machine role. If software update is enabled is IISReset not needed because the application pool will be recycled automatically (note that IISReset is deprecated, recycling the application pool is faster and can be done without downtime). See https://www.leansentry.com/guide/reset-restart-recycle-iis for some guidance about the use of IIReset.