This document guides you with the assumption that you have set up WSO2 Open Banking Key Manager and WSO2 Open Banking API Manager on separate servers.
Configuring the velocity_template.xml
Make sure to update the <WSO2_OB_KM_HOST>
parameter in the consent enforcement handler of the <WSO2_OB_APIM_HOME>/repository/resources/api_templates/velocity_template.xml
file, before creating the APIs.
<handler class="com.wso2.finance.open.banking.uk.consent.enforcement.ConsentEnforcementHandler"> #if($!apiVersion == "v3.0" || $!apiVersion == "v3.1" || $!apiVersion == "v3.1.1") <property name="accountValidationUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300/accounts-validation"/> <property name="paymentConsumtionUpdateUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300/payments/{PaymentType}/{ConsentId}/status/{Status}"/> <property name="paymentSubmissionValidationUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300/payment-submission-validation"/> <property name="paymentConsentDataUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300/payments/{PaymentType}/{ConsentId}/Consumption"/> <property name="fundConfirmationValidationUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300/funds-confirmation-validation"/> #elseif($!apiVersion == "v2.0") <property name="accountValidationUrl" value="https://<WSO2_OB_KM_HOST>::9446/consent/uk200/accounts-validation"/> <property name="paymentSubmissionValidationUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk110/payment-submission-validation"/> #else <property name="accountValidationUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk110/accounts-validation"/> <property name="paymentSubmissionValidationUrl" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk110/payment-submission-validation"/> #end <property name="keyStore" value="./repository/resources/security/wso2carbon.jks"/> <property name="password" value="wso2carbon"/> <property name="alias" value="wso2carbon"/> </handler>
Configuring sequence files
In order to update the In Sequence file for the Accounts, Payment, and Confirmation of Funds APIs, update the relevant XML
file from the <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/openbanking.org.uk/<Name of the API>/<version of the API>
directory.
Update the <WSO2_OB_KM_HOST>
and <WSO2_OB_APIM_HOST>
placeholders with the hostname of the WSO2
OB
KM
and APIM
servers respectively.
If you are using the following deployment options, update the placeholders as follows:
Replace the <WSO2_OB_KM_HOST>
and <WSO2_OB_APIM_HOST>
placeholders with the IP addresses of the puppet agents that run WSO2
OB
KM
and APIM
respectively.
Replace the <WSO2_OB_KM_HOST>
and <WSO2_OB_APIM_HOST>
placeholders with the hostnames of WSO2
OB
KM
and APIM
in the Docker network respectively.
For example, if you use our Docker Compose resources without any modifications, the placeholder values are obkm
and obam
.
Replace the <WSO2_OB_KM_HOST>
and <WSO2_OB_APIM_HOST>
placeholders with the names of the internal services related to the deployment of WSO2
OB
KM
and APIM
respectively.
For example, if you use the Kubernetes resources for WSO2 Open Banking - Deployment pattern 1 without any modifications, the placeholder values are https://wso2ob-pattern-1-obam-service
and https://wso2ob-pattern-1-obkm-service
.
For deployment patterns, see Open Banking API Manager High Availability Deployment.
Change the
<WSO2_OB_KM_HOST>
of the following configuration:<filter regex=".*\/account-access-consents.*" source="$ctx:endpointURI"> <header name="To" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300" />
Change the
<WSO2_OB_APIM_HOST>
of the following configuration:<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <header name="To" value="https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/accounts/accountservice" /> </then> <else> <header name="To" value="https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/accounts/accountservice" /> </else>
Change the
<WSO2_OB_KM_HOST>
of the following configuration:<filter source="get-property('routeToBackend')" regex="false"> <header name="To" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300/payments"/>
Change the
<WSO2_OB_APIM_HOST>
of the following configurations:<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <header name="To" value="https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/payments/paymentservice"/> </then> <else> <header name="To" value="https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/payments/paymentservice"/> </else> </filter>
Change the
<WSO2_OB_KM_HOST>
of the following configuration:<filter regex=".*\/funds-confirmation-consents.*" source="$ctx:endpointURI"> <header name="To" value="https://<WSO2_OB_KM_HOST>:9446/consent/uk300" />
Change the
<WSO2_OB_APIM_HOST>
of the following configurations:<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <header name="To" value="https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/fundsConfirmation/fundsconfirmationservice" /> </then> <else> <header name="To" value="https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/fundsConfirmation/fundsconfirmationservice" /> </else> </filter>
By default, a mock backend is configured in the In Sequence file of the API Manager instance in WSO2 Open Banking. Ideally, the two occurrences of https://<WSO2_OB_APIM_HOST>:9443/open-banking/services/accounts/accountservice
under the <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
parameter should be replaced by the core banking system's API endpoints corresponding to the production and sandbox environments respectively. For more information on how to integrate a core banking system, see Integrating Core Banking System.
This is available only as a WUM update and is effective from September 23, 2019 (09-23-2019). For more information on updating WSO2 Open Banking, see Updating WSO2 Products. Add the following configuration to the Displaying the error response for access token failures in the UK error format
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/auth_failure_handler.xml
under the <sequence key="_cors_request_handler_"/>
configuration to display the error response for access token failures in the UK error format.<filter source="get-property('REST_API_CONTEXT')" regex=".*\/(pisp|aisp|cbpii).*">
<then>
<class name="com.wso2.finance.open.banking.gateway.uk.AuthFailureResponseCreationMediator"/>
<respond/>
</then>
</filter>
Create and publish an API
In WSO2 Open Banking 1.4.0 it is mandatory to configure the following APIs:
- Accounts API v3.1.1
- Payments API v3.1.1
- Confirmation of Funds API v3.1.1
If you have already deployed v3.1 APIs:
According to OBIE, the v3.1 and v3.1.1 APIs have the same context values. Therefore, if you have already deployed v3.1 APIs, the v3.1.1 APIs cannot be deployed as new versions of existing APIs. You have to update the swagger file content.
Follow the steps given below to create and publish an API.
- Create a user with Internal/creator and Internal/publisher roles in order to configure the API. For more information on creating a user, refer Configuring users and roles.
- If an API is already deployed with a previous version, you may create a new version of it instead of deploying a new API. For more information, see Create a new version for an existing API.
You can configure APIs through the API Publisher by signing in as a user whose role includes
Internal/publisher
. Follow the steps given below:
Sign in to the API Publisher (
https://
localhost
:9443/publisherClick ADD NEW API > I have an existing API.
Select the Swagger definition from
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis
and configure the properties according to the open-banking specification. Find more information from the table given below.
Click Start Creating.- Click Next: Implement to navigate to the next level.
- Expand Managed API, and use the table below to select the relevant Endpoint Type from the drop down list.
- Check Select a message mediation policy to be executed in the message flow under Message Mediation Policies.
Click Upload In Flow and select the corresponding In sequence file from
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis.
Click Next: Manage to navigate to the next level.
- Expand Throttling Settings. Under Subscription Tiers, check the option as Unlimited : Allows unlimited requests unless you want to limit the requests.
Expand API Properties and add the following values as Additional properties. Click the + button to save the above values.
Property Name
ob-spec Property Value
uk Configure the open banking specification and the API type for the DCR API you deploy as follows:
This is available only as a WUM update and is effective from June 07, 2020 (06-07-2019). For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
- Click Save & Publish.
Summarized information for configuring APIs - UK specification
API | Implement tab | Manage tab | ||||
---|---|---|---|---|---|---|
Endpoint type | Endpoint | Enable Message mediation | In flow | API property name | API property value | |
AccountInfo API v3.1.1 | Dynamic | N/A | Mark as checked |
| ob-spec | uk |
Payments API v3.1.1 | Dynamic | N/A | Mark as checked
| <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/openbanking.org.uk/Payments/3.1.1/payments-dynamic-endpoint-insequence-3.1.1.xml | ob-spec | uk |
Funds Confirmation API v3.1.1 | Dynamic | N/A | Mark as checked |
| ob-spec
| uk |
Event Notifications API v3.1.0 | Dynamic | N/A | Mark as checked | <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/openbanking.org.uk/Notifications/3.1.0/notifications-dynamic-endpoint-insequence-3.1.0.xml | ob-spec | uk |
Dynamic ClientRegistration API v3.2 | Dynamic | N/A | Mark as checked | <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/openbanking.org.uk/DynamicClientRegistration/3.2/dcr-dynamic-endpoint-insequence-3.2.xml | ob-api-type | dcr |
In the API Publisher of WSO2 Open Banking, users are not allowed to duplicate the scope of an API. Therefore, users are allowed to create a new version for the API in order to share the same scope. See below to find how it is done: Select the CREATE NEW VERSION tab. Follow the versioning format and define the new version. Click Done. Users need to define the correct version for the API and choose the swagger and In sequence files appropriately. The directory path to the files in the solution pack helps you to choose the correct file. For example, choose the swagger and in sequence files from Click Save & Publish. To get the existing subscriptions to the new version, follow the steps below:Create a new version for an existing API
https://<WSO2_OB_APIM_HOST>:9443/publisher
), click the API thumbnail to view the API overview.<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/openbanking.org.uk/Accounts/3.1.0
if you want to create the 3.1.0 version of Payment Initiation API..yaml
format and click Open File.In sequence
file for the corresponding API and its version, and click Upload.ob-spec
property is set to reflect the correct specification.
Tick the relevant boxes if you want to: