Access other topics through write plugin

We wrote a write plugin to copy language level metadata from the previously released language to the newly created one. This requires getting access to an object which didn't invoke the write plugin. In trying to do that I get an error for authentication. We are using ADFS for our security. How can I refuse the token, to authenticate to access other objects in the repo?

  • Please try to share at least the basics of your code base. Accessing resources beyond the ones available from the sdk has been a point of discussion, and there are a couple of alternatives. Once you share your code then we can proceed. I think that the PS team has already they preferred solution.
  • Hi Alex,
    Here is snippet of the code, let me know if you need to see the complete code and I can email it to you.
    public void Run(IWriteMetadataContext context)
    Uri serviceUrl = new Uri(@"https://<serverName>/ISHWS/");
    InfoShareWSHelper infoShareWSHelper = new InfoShareWSHelper(serviceUrl);
    infoShareWSHelper.Resolve();
    //Issue a token. In other words authenticate
    infoShareWSHelper.IssueToken();
    ...
    string xmlString = userClientDocumentObj.RetrieveObjects(logicalids, DocumentObj25ServiceReference.StatusFilter.ISHNoStatusFilter, XMLMetadataFilter, "", xmlRequestedMetadata);

    The error I get
    Error 20 00108 a:UC:ajain Trisoft.InfoShare.Business.DocumentObject.Create [[]]
    Trisoft.InfoShare.Plugins.Host.ErrorRunningPluginException: The plug-in "CREATELANGUAGUES" returned the following error: "[-1] The access is denied because no profile match was found. 0" ---> System.ServiceModel.FaultException`1[MyCustomPluginLibrary.DocumentObj25ServiceReference.InfoShareFault]: [-1] The access is denied because no profile match was found. 0

    Thank you in advance for your assistance with this issue.
  • Dear Akheil,

    Please find below the assemblies you should reference in your IWritePlugin project.

    - Trisoft.Infoshare.API25 (Trisoft.Infoshare.API25.dll)
    - Trisoft.Infoshare.API20 (Trisoft.Infoshare.API20.dll)
    - Trisoft.Infoshare.API.Enumarations (Trisoft.Infoshare.API.Enumarations.dll)
    - Trisoft.Infoshare.API.Interfaces (Trisoft.Infoshare.API.Interfaces.dll)

    These assemblies are available on an installed environment in the following path:
    <drive-letter>:\Infoshare\AppCore\Common
    Or on a CD package in the following path (taken from OOTB 12.0.4 CD):
    <drive-letter>:\20170528.CD.InfoShare.12.0.4128.4.Trisoft-DITA-OT\Applications\Common

    This will allow you to utilize the available API wrapper functions with the currently used token.
    Example code which will return properties of your own (currently used) user account:

    public static IshObject GetMyMetadata(string reqMetadata) {
    string xmlUser = string.Empty;
    XDocument userList = null;

    using (Trisoft.InfoShare.API25.User userClient = new Trisoft.InfoShare.API25.User()) {
    userClient.GetMyMetadata(reqMetadata, out xmlUser);
    if (!string.IsNullOrEmpty(xmlUser)) {
    userList = XDocument.Parse(xmlUser);
    }
    }

    return userList;
    }

    Kind Regards,

    Raf