Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Content Zone
locationtop
Note

The Summarisation feature in Data Reporting is supported only for MSSQL database servers.

Configuring Open Banking Key Manager

Open the <WSO2_OB_KM_HOME>/repository/conf/finance/open-banking.xml file and add the following configurations below the </Analytics> tag. 

  • Replace the <WSO2_OB_BI_HOST> placeholder with the hostname of your WSO2 Open Banking Business Intelligence (WSO2 OB BI) server and configure other parameters accordingly. 
  • To publish the statistics set the value of the <Enabled> tag to true.
Code Block
languagexml
<BIServer>
	<MIReporting>
		<Enabled>true</Enabled>
		<ServerURL>{tcp://<WSO2_OB_BI_HOST>:7616}</ServerURL>
		<Username>admin</Username>
		<Password>admin</Password>
	</MIReporting>
</BIServer>

Configuring Open Banking API Manager

Configuring open-banking.xml

Open the <WSO2_OB_APIM_HOME>/repository/conf/finance/open-banking.xml file and add the following configurations below the </Analytics> tag. 

  • Replace the <WSO2_OB_BI_HOST> placeholder with the hostname of your WSO2 Open Banking Business Intelligence (WSO2 OB BI) server and configure other parameters accordingly. 
  • To publish the statistics set the value of the <Enabled> tag to true.
Code Block
languagexml
<BIServer>
	<MIReporting>
		<Enabled>true</Enabled>
		<ServerURL>{tcp://<WSO2_OB_BI_HOST>:7616}</ServerURL>
		<Username>admin</Username>
		<Password>admin</Password>
	</MIReporting>
</BIServer>

Configuring handlers

Open the <WSO2_OB_APIM_HOME>/repository/resources/api_templates/velocity_template.xml file and do the following:

  1. Add the APIInvocationLatencyStats handler just after the <handlers xmlns="http://ws.apache.org/ns/synapse"> tag.

    Code Block
    languagexml
    <handler class="com.wso2.finance.open.banking.management.information.reporting.data.publisher.APIInvocationLatencyStatsHandler"/>
  2. Add the APIInvocationDataPublisher handler as the last ob-specific handler, right before the ## end of ob-specific handlers before the APIManagerExtensionHandler line. 

    Code Block
    <handler class="com.wso2.finance.open.banking.management.information.reporting.data.publisher.APIInvocationDataPublisher" />
    
    ## end of ob-specific handlers before the APIManagerExtensionHandler
Note

Republish all the APIs for the above changes to take effect.

Multiexcerpt
MultiExcerptNameInvocationFailure
Capturing data during invocation failure scenarios

This is available only as a WUM update and is effective from December 20, 2019 (12-20-2019). For more information on updating WSO2 Open Banking, see  Updating WSO2 Products .

  1. Go to the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences directory.
  2. Create an XML file named api_invocation_fail_data_publisher.xml with the following content: 

    xml
  3. Open the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/_throttle_out_handler_.xml file and add the  OBErrorDataPublisher  class under the sequence tag. 

  4. Open the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/_auth_failure_handler_.xml file and add the  OBErrorDataPublisher  class after the AuthFailureResponseCreationMediator class as follows:

    If you can't locate the AuthFailureResponseCreationMediator class in the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/

    _auth_failure_handler_.xml file, please see .

Configuring Open Banking Business Intelligence

Configuring databases

Create the following databases in your database server to store raw and summarized data.

  • openbank_ob_reporting_statsdb
  • openbank_ob_reporting_summarizeddb

Configuring datasources

Update the <WSO2_OB_BI_HOME>/conf/worker/deployment.yaml file by adding the datasource configurations for OB_REPORTING_DB and OB_REPORTING_SUMMARIZED_DB

  • Update the jdbcUrlusernamepassword and driverClassName in the datasource entry with your database configurations.
  • Add the configurations after the TRA_DB datasource configurations.
    A sample configuration is given below:
Code Block
languagexml
- name: OB_REPORTING_DB
    description: The datasource used to store statistics for OB MI module
    jndiConfig:
      name: jdbc/OB_REPORTING_DB
    definition:
      type: RDBMS
      configuration:
        jdbcUrl: 'jdbc:sqlserver://192.168.108.23:1433;databaseName=openbank_ob_reporting_statsdb'
        username: 'root'
        password: 'root'
        driverClassName: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
        maxPoolSize: 20
        idleTimeout: 60000
        connectionTestQuery: SELECT 1
        validationTimeout: 30000
        isAutoCommit: false

  - name: OB_REPORTING_SUMMARIZED_DB
    description: The datasource used to store summarized data for OB MI module
    jndiConfig:
      name: jdbc/OB_REPORTING_SUMMARIZED_DB
    definition:
      type: RDBMS
      configuration:
        jdbcUrl: 'jdbc:sqlserver://192.168.108.23:1433;databaseName=openbank_ob_reporting_summarizeddb'
        username: 'root'
        password: 'root'
        driverClassName: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
        maxPoolSize: 20
        idleTimeout: 60000
        connectionTestQuery: SELECT 1
        validationTimeout: 30000
        isAutoCommit: false

Adding summarization script
  1. Download the OB_REPORT_SUMMERIZATION_MSSQl.siddhi script from here.

  2. Place the script in the <WSO2_OB_BI_HOME>/deployment/siddhi-files directory.

Restart the WSO2 Open Banking Business Intelligence, Key Manager and API Manager servers in the mentioned order, for the changes to take place.

[Back to Top]

Data Reporting API

If you're using a customised consent authentication web application, you may use the Data Reporting API to publish events from the application. Invoke the Data Reporting API in all the relevant places to publish the PSU and authorisation data to the reporting databases.

In the following scenarios, events are captured using the consent authorisation web app:

  • The user visiting the consent page
  • After the user authorising/denying the consent
Expand
titleClick here for sample requests
Note

In the scenarios above, Accounts, Payments or Confirmation of Funds (COF) API is invoked.  Given below are sample requests to invoke the Data Reporting API. Update the request body according to the scenario that you want to capture the events.

The user visiting the consent page

Localtabgroup
Localtab
titleAccounts
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/account' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "reAuth": "true",
  "timestamp" : "1560832453",
  "authorisationStatus" : "AuthorisationRequired"
}'
Localtab
titlePayments
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/payment' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "authorisationStatus" : "AuthorisationRequired",
  "multiAuth" : "false",
  "multiAuthUsers" : 0
}'
Localtab
titleCOF
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/fund-confirmation' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "authorisationStatus" : "AuthorisationRequired"
}'

After the user authorising/denying the consent

Localtabgroup
Localtab
titleAccounts
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/account' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "reAuth": "true",
  "debtorAccountIds": [
    "1233444",
    "9875432"
  ],
  "timestamp" : "1560832453",
  "authorisationStatus" : "Authorised"
}'
Localtab
titlePayments
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/payment' \
--header 'Content-Type: application/json' \
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "debtorId" : "1223333343",
  "authorisationStatus" : "Authorised",
  "multiAuth" : "true",
  "multiAuthUsers" : 3
}'
Localtab
titleCOF
Code BlockConfirmation of Funds curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/fund-confirmation' \ --header 'Content-Type: application/json' \ --data-raw '{ "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5", "clientId": "1234", "userId" : "psu1@wso2.com", "timestamp" : "15608324545", "debtorId" : "1223333343", "authorisationStatus" : "Authorised" }'
  1. Note

    The Siddhi script linked in step 1 is updated in the latest WUM updated solution. If your setup contains WUM updates released on or after April 07, 2021 (04-07-2021), follow the steps below to use the updated Siddhi scripts.

    Expand
    titleClick here to see how to use the updated Siddhi scripts...
    1. Run the relevant database script in the <WSO2_OB_BI_HOME>/resources/finance/dbscripts/uk/migration-publishing-org-id/ob_stats_db directory to add the ORG_ID column to the APP_REG_RAW_DATA table.
    2. Open the <WSO2_OB_APIM_HOME>/repository/conf/finance/open-banking.xml file and enable data publishing. Set the following configuration under the <BIServer> tag, to true

      Code Block
      languagexml
      <DataPublishing>
      	<PublishOrganizationID>true</PublishOrganizationID>
      </DataPublishing>
    3. Open the <WSO2_OB_APIM_HOME>/repository/conf/api-manager.xml file and under the <ApplicationAttributes> tag, add the following configurations: 

      Code Block
      languagexml
      <Attribute required="false">
      	<Name>org_id_production</Name>
      	<Description>Organization ID of the Production</Description>
      </Attribute>
      <Attribute required="false">
      	<Name>org_id_sandbox</Name>
      	<Description>Organization ID of the Production</Description>
      </Attribute>
    4. Update the Siddhi scripts for raw-data tables. 
      1. Copy the scripts in the <WSO2_OB_BI_HOME>/resources/finance/siddhi-files/uk directory.
      2. Paste them in the <WSO2_OB_BI_HOME>/deployment/siddhi-files directory and replace the existing scripts.
    5. Update the Siddhi scripts for summatization-data tables.
      1. Copy <WSO2_OB_BI_HOME>/resources/finance/siddhi-files/uk/mi-reporting/3.0/OB_REPORT_SUMMERIZATION_MSSQl.siddhi.
      2. Paste it in the <WSO2_OB_BI_HOME>/deployment/siddhi-files/ directory and replace the existing OB_REPORT_SUMMERIZATION_MSSQl.siddhi script.

Restart the WSO2 Open Banking Business Intelligence, Key Manager and API Manager servers in the mentioned order, for the changes to take place.

Info
titleFix the issue in calculating the TPP count

This is available only as a WUM update and is effective from April 07, 2021 (04-07-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products.

Expand
titleClick here to see how to apply the fix...

Step 1 - Update database 

  1. Run the relevant database script in the <WSO2_OB_BI_HOME>/resources/finance/dbscripts/uk/migration-publishing-org-id/ob_stats_db directory to add the ORG_ID column to the APP_REG_RAW_DATA table.
  2. Migrate your existing data in the APP_REG_RAW_DATA table by adding the correct ORG_IDs of the registered applications.

Step  2 - Enable data publishing

This is to enable publishing TPP's Organization-ID to the APP_REG_RAW_DATA database table.

  1. Open the <WSO2_OB_APIM_HOME>/repository/conf/finance/open-banking.xml file.
  2. Enable data publishing by setting the following configuration under the <BIServer> tag, to true

    Code Block
    languagexml
    <DataPublishing>
    	<PublishOrganizationID>true</PublishOrganizationID>
    </DataPublishing>
  3. Open the <WSO2_OB_APIM_HOME>/repository/conf/api-manager.xml file.
  4. Under the <ApplicationAttributes> tag, add the following configurations: 

    Code Block
    languagexml
    <Attribute required="false">
    	<Name>org_id_production</Name>
    	<Description>Organization ID of the Production</Description>
    </Attribute>
    <Attribute required="false">
    	<Name>org_id_sandbox</Name>
    	<Description>Organization ID of the Production</Description>
    </Attribute>
  5. Restart WSO2 Open Banking API Manger server.
  6. Replace the existing AppRegistrationDataSubmissionApp.siddhi.
    1. Copy <WSO2_OB_BI_HOME>/resources/finance/siddhi-files/uk/AppRegistrationDataSubmissionApp.siddhi.
    2. Paste it in the <WSO2_OB_BI_HOME>/deployment/siddhi-files/ directory and replace the existing AppRegistrationDataSubmissionApp.siddhi file.

Step 3 - Enable TPP calculation

  1. Replace the OB_REPORT_SUMMERIZATION_MSSQl.siddhi file.
    1. Copy <WSO2_OB_BI_HOME>/resources/finance/siddhi-files/uk/mi-reporting/3.0/OB_REPORT_SUMMERIZATION_MSSQl.siddhi.
    2. Paste it in the <WSO2_OB_BI_HOME>/deployment/siddhi-files/ directory and replace the existing OB_REPORT_SUMMERIZATION_MSSQl.siddhi file.
  2. The TPPs can register applications using Dynamic Client Registration (DCR), Manual Client Registration (MCR), or Signup workflow

    Note

    If you allow to TPP application registration using Signup workflows (using the WSO2 API Store), it is mandatory to use a QSeal certificate during the production/sandbox key generation.


Data Reporting API

If you're using a customised consent authentication web application, you may use the Data Reporting API to publish events from the application. Invoke the Data Reporting API in all the relevant places to publish the PSU and authorisation data to the reporting databases.

In the following scenarios, events are captured using the consent authorisation web app:

  • The user visiting the consent page
  • After the user authorising/denying the consent

For sample requests, see Data Reporting API.