This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Deploying APIs for Berlin
This document guides you with the assumption that you have set up the WSO2 Open Banking Identity and Access Management and API Management modules on separate servers.
Configuring the velocity_template.xml
- Open the
<WSO2_OB_APIM_HOME>/repository/resources/api_templates/velocity_template.xml
file. - Update the
<IAM_HOSTNAME>
placeholder with the hostname of your Identity and Access Management server.
To return proper error messages when the transport certificate validation fail:
This is available only as a WSO2 Update and is effective from October 11, 2021 (10-11-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
- Open the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/api/TokenAPI.xml
file. Add the following handler at the end of the existing handler chain.
<handler class="com.wso2.finance.open.banking.gateway.common.MTLSErrorValidationHandler"/>
- Save the change and restart the API Manager server.
Configuring sequence files
- Go to the
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/berlin-group.org/<API_Name>/<API_version>
directory. - Find the in sequence file of the API you wish to deploy.
Based on the port, update the references of the hostnames to the hostname of your servers.
Port number
Update the local
9443 Hostname of the API Management server 9446 Hostname of the Identity and Access Management server For example, if the URL is
https://localhost:9446/api/openbanking/consent-mgt/berlin130/payments
, it should be updated with the hostname of the Identity and Access Management server:https://<WSO2_OB_IAM_HOST>:9446/api/openbanking/consent-mgt/berlin130/payments
If you are using the following deployment options, update the placeholders as follows:
- By default, a mock backend is configured in the in sequence files of the API Manager. The two endpoints 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.
Update the Swagger file
- Open the
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/berlin-group.org/PSD2API_1.3.6/psd2-api_1.3.6_20200327.yaml
file using a text editor. Locate the
maxItems: 11
property and list it below thetype:array
property.- Save the changes.
Create and publish an API
In WSO2 Open Banking for Berlin, you can configure the following APIs:
- Accounts API
- Payments API
- Confirmation of Funds API
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, see 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 Portal (
https://<WSO2_OB_APIM_HOST>:9443/publisher
).In the APIs tab, select CREATE NEW API > I Have an Existing REST API.
- Set the Input Type to OpenAPI File.
- Click BROWSE FILE TO UPLOAD and select the
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/berlin-group.org/PSD2API_1.3.6/psd2-api_1.3.6_20200327.yaml
Swagger definition (.yaml file). - Click Next.
- Leave the Endpoint field empty as it is.
Set the Context value as follows:
xs2a
- Set the business plan to Unlimited : Allows unlimited requests unless you want to limit the requests.
- Click Create to create the API.
- Once you get the message that the API is successfully updated, go to Runtime Configurations using the left menu panel.
- Click the edit button under Request > Message Mediation.
- Now, select the Custom Policy option.
- Upload the
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/berlin-group.org/PSD2API_1.3.6/dynamic-endpoint-insequence-1.3.6.xml
file and click SELECT. - Scroll down and click SAVE.
- Go to Endpoints using the left menu panel.
- Select Dynamic Endpoint.
- Select the endpoint types; Production Endpoint/Sandbox Endpoint.
- Click Save.
- Now, go to Properties using the left menu panel.
- Click Add New Property.
Add the API Properties according to your API and click the Add button.
Property Name
Property Value
ob-spec
berlin
ob-api-type
psd2
For example:
- Click SAVE.
- Go back to Overview using the left menu panel.
- Click PUBLISH.
- The published API is available in the Developer Portal at
https://<WSO2_OB_APIM_HOST>:9443/devportal
.
Summarized information for configuring APIs
API | Swagger definition (yaml file) | Endpoint | Message mediation (sequence file) | API property name | API property value |
---|---|---|---|---|---|
NextGenPSD2 Framework Version 1.3.6 | <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/berlin-group.org/PSD2API_1.3.6/psd2-api_1.3.6_20200327.yaml | Dynamic Endpoint |
| ob-spec | berlin |
ob-api-type | psd2 |
Configure the FrequenyPerDay throttling policy
The FrequencyPerDay
value is sent in the consent initiation request body to indicate the requested maximum frequency for access without PSU involvement per day. According to the NextGenPSD2 XS2A framework, the FrequencyPerDay
value needs to be checked when the PSU's IP address is not sent in an API invocation request.
For one-off access, this attribute has to be set to '1'. The frequency has to be greater than or equal to 1.
Use the below instructions to configure the FrequencyPerDay throttling policy:
Open
<WSO2_OB_APIM_HOME>/repository/conf/deployment.toml
.Change the attributes under the
apim.throttling
tag as follows:[apim.throttling] enable_data_publishing = true jms.topic_connection_factory = "amqp://admin!wso2.com!carbon.super:$ref{super_admin.password}@clientid/carbon?brokerlist='tcp://${carbon.local.ip}:${jms.port}'" receiver_username = "$ref{super_admin.username}@carbon.super"
Make sure that the FrequencyPerDay property is enabled as follows:
[open_banking.berlin.freq_per_day] enable = true
Open the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/api/<publisher-name>--NextGenPSD2XS2AFramework_v1.xml
file and place CustomThrottlingPolicyHandler before ThrottleHandler as follows:<handler class="com.wso2.finance.open.banking.custom.throttling.CustomThrottlingPolicyHandler"/> <handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.ThrottleHandler"/>
Deploy the throttling policy located in
<WSO2_OB_APIM_HOME>/repository/resources/finance/scripts/wso2-obam-conf/FrequencyPerDayPolicy
as
a custom throttling policy in the admin portal of WSO2 Open Banking API Manager. See here for the instructions.In step 3, use $customProperty.accountId:$customProperty.consentId:$userId:$appId as the key template.
Create a new version for an existing API
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 of the API to share the same scope.
Sign in to the WSO2 API Publisher at
https://<WSO2_OB_APIM_HOST>:9443/publisher
.- Navigate to the API listing page, and select the API for which you want to create a new version.
Click Create New Version.
Enter a version number and click Create.
You are redirected to the API Overview page.
- Go to API Definition using the left menu panel.
- Click IMPORT DEFINITION
. Set the Input Type to OpenAPI File.
Click BROWSE FILE TO UPLOAD and select the Swagger definition (.yaml file) according to your API.
Click IMPORT. The changes are auto-saved.
- Go to Runtime Configurations using the left menu panel.
- Click the edit button under Request > Message Mediation.
- Now, select the Custom Policy option.
- Upload the relevant in-sequence file and click SELECT.
- Scroll down and click SAVE.
Go to Lifecycle using the left menu panel.
- Check Deprecate old versions after publishing the API checkbox, if you want to deprecate previous versions.
Check Requires re-subscription when publishing the API checkbox, only if you want to remove the subscriptions from the previous version.
Leave the Requires Re-Subscription when publishing the API checkbox cleared if you want all users who are subscribed to the older version of the API to be automatically subscribed to the new version. If not, they need to subscribe to the new version again.
- Click Publish .
Request payload validation
Request payload validation adds flexibility to validate an incoming request against any customisations done to the swagger definition.
For example, remove an enumeration from an existing set and check whether the incoming request contains the defined enumerations.
When an API is published, the swagger file is added as a local entry and saved under the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/local-entries
directory.
To add the swagger as a local entry, the created and published API lifecycles are extended using customised API executor named com.wso2.finance.open.banking.api.executor.OBAPIPublisherExecutor
. For more information on executors, see Extension Points of API Life cycle.
When you modify the Swagger, the solution will validate the incoming request against the updated Swagger file. If you modify the Swagger after publishing the API, republish the API to apply the swagger based validations. Therefore, follow the steps below: