i4connected Knowledgebase 5.6

The i4connected API

Abstract

Check out this article and learn how to set up your i4connected API by going through the tutorials we have carefully prepared for you.

Setting up Internet Information Services
Abstract

Check out this article and learn how to deploy the i4connected portal on your working machine, by mapping the portal folder to IIS.

The first step when installing the i4connected application API consists of mapping the portal folder to IIS, through a custom application pool, by following the below-described steps:

  1. Save the contents of the portal folder in the desired place on the hard drive. It is advisable not to use a very long folder path for storing the portal's files.

  2. Open the Internet Information Services (IIS) Manager and expand the Connections tree structure in order to reach the Application Pools node.

  3. Right-click on the node and select the Add Application Pool option.

    Add_App_Pool.jpg
  4. In the Add Application Pool dialog fill in the following settings:

    API_App_Pool.jpg
    1. Name - Name of the new i4connected Application Pool. For the current tutorial, we will use the "i4connected_API" name.

    2. .NET CLR version - select No Managed Code option.

    3. Managed pipeline mode - select the Integrated option.

  5. Click the OK button to save the new Application Pool.

  6. Select the new Application Pool in the list view via right-click. Select the Advanced Settings option.

  7. In the Advanced Settings dialog set the Load User Profile option to TRUE.

    Load_User_Profile.jpg

    Tip

    If you access the SQL Server on a different server, then you need to set the Identity to a User which has access to the Analysis Services of the SQL Server. In our case, it’s the previously mentioned" ServiceUser” account.

  8. Next, select the i4connected Website and select the Add Application option.

    Add_Application.jpg

    Tip

    API can be added as a separate application, not necessarily under the i4connected pool. However, in this case, the Site bindings should be properly updated.

  9. In the Add Application dialog configure the new application as follows:

    Add_API_App.jpg
    1. Alias - the alias of the IIS application (for example "API").

    2. Application pool - click the Select button and add the Application Pool you created at step 4.

    3. Physical path - use the Browse For Folder selector to apply the i4connected API folder.

    4. Next, click the OK button to save your changes.

Editing the API configuration files
Abstract

Check out this article and learn how to edit the i4connected API configuration files in just a few easy and fun steps.

After processing the changes at the level of the Internet Information Services (IIS) application, we need to edit the API configuration files to set up the correct endpoints, in order to communicate with the Analysis Services and the SQL Database, as follows:

  1. Open the i4connected API folder, identify the WEBfactory.DWH.Web.Core.exe.config file and open it using an editor tool.

    CoreFolder.jpg
  2. The WEBfactory.DWH.Web.Core.exe.config provides the Connection strings for the Analysis Service and SQL Database. Check if the connection strings are correct and if not, make the necessary updates.

    Core_exe_fle.jpg

    Tip

    Further on, if a proxy is needed to reach the internet you can add the following into the WEBfactory.DWH.Web.Core.exe.config file directly in front of the <runtime> definitions:

       <system.net>
            <defaultProxy
    enabled="true">
            <proxy
    bypassonlocal="true"
                proxyaddress="http://ip_oder_name:Port/" />
            </defaultProxy>       
        </system.net>
    
  3. Make sure to save your changes.

  4. Next, open the i4connected API folder, identify the appsettings.json file and open it using an editor tool.

    API_appsettings_json.jpg
  5. Make sure that the Authority Uri points to the API site, using the same protocol (HTTP or HTTPS).

    Tip

    The Authority Uri should point to the i4connected API site. The Uri should not end with the "/" character.

    For example http://localhost/api

    AuthorityAPI.jpg

    In case your i4connected portal should be accessible by any other external services, you must also define the PublicUri.

Tip

If you desire to use your i4connected environment in association with the Swagger application, it is necessary to edit the redirect URL of the API in the database, as follows:

  1. Open the Database in the SSMS and go to the table ClientRedirectUris.

  2. Open the table in edit mode and change the row with the ClientId 3 to use the IP/name of the API.

    Tip

    For example http://192.168.0.xxx/api/docs/oauth2-redirect.html

Note

When installing an i4connected 5.5.20 or later version, you can set an optional property named "IssuerUri" in the appsettings.json file. The issuer name should be set to the one appearing in the discovery document and the issued JWT tokens.

Organizing this step could be useful if a Server is behind a Proxy.

Setting up RabbitMQ for Effective permissions
Abstract

In order that the i4connected effective permissions be applied to your i4connected portal please follow the RabbitMQ installation and configuration guidelines.

Important

The Effective permissions feature is only available for i4connected 5.6 version. If your application version is lower, these steps are not needed.

The new i4connected security model enforces a new set of permissions, also known as Effective Permissions. The API settings for them, are stored under the appsettings.json file and can be customized by the user, as follows:

  1. Open the i4connected API folder and identify the appsettings.json file.

  2. Open the appsettings.json file with an editor tool and proceed with the following settings, under the Effective Permissions section:

    Note

    In case no custom changes are needed, RabbitMQ Server will take the default values for Effective Permissions, which are:

    Effective_permissions_API.jpg
    • RabbitMqUri - amqp://localhost

    • RabbitMqExchange - effective.permissions

    • RabbitMqQueueName - effectivePermissions

    • ConfirmPublishTimeout - 30sec

    However, in case the RabbitMQ Server will be used for more than one i4connected installation, these settings need to be customized for each i4connected setup.

    1. RabbitMQUri - the Url pointing towards the RabbitMQ Server.

      Tip

      The Url will be formatted as follows: amqp://user:password@host:port/vh.

    2. RabbitMQEXchange - the name of the RabbitMQ Exchange.

      Important

      In case you are using your own RabbitMQ server, please provide the WEBfactory team with the name of your RabbitMQ Exchange.

      Please also make sure that yourRabbitMQ Exchange meets the following requirements:

      • Exchange Type - Direct

      • Exchange Durability - Durable

      • Exchange Auto delete - No

    3. RabbitMqQueueName - the name of the Queue configured in the RabbitMQ Server application.

    4. ConfirmPublishTimeout - the custom timeout value for confirming the data publishing.

  3. Make sure that the respective lines are enabled (uncommented).

Note

RabbitMQ also requires some settings at the level of the i4connected Server. For more details please also visitthe dedicated article, here