Prerequisite


Open-Banking Base URL

AISP https://ksaob-api.retail-ksaob-sbx.banfico.io/ksaob-aisp/open-banking/account-information/2024.09.01-final-errata1

Well-Known URL

Well-Known https://auth.retail-ksaob-sbx.banfico.io/auth/realms/retail/.well-known/openid-configuration

To test the Open Banking APIs, it is necessary to obtain two different registrations

  1. Third Party Registration (TPP via Developer Portal)
  2. Customer Registration (PSU via Core Bank)

To obtain the above user registrations refer to the below links:

  1. Third Party Registration : Learn more at Developer Onboarding
  2. Customer Registration: Learn more at Core Bank to simulate Core Banking
  3. Third Party must create an app to test : Learn more at Developer App Management
  4. Preferred Postman version is v10.23

Postman Setup

After all the pre-requisites are completed, APIs can be tested using the Postman.

  1. Download and Import the below Collection and Environment files into Postman
KSA-OB.postman_collection.json
KSA-OB.postman_environment.json
  1. Open the Environment KSAOB-SIT and update the Client_ID and Client_Secret values for AISP/PISP/LGSP, as per the TPP that needs to be validated. Save the Changes.
  2. Open the Collection KSA-OB and Select the Environment KSAOB-SIT

Currently supported type of flows:

  1. Web to Web Redirect Flow - This is be tested with different client authentication flows like client_secret_basic or private_key_jwt using client_certificate or JWKS
  2. App-to-App Redirect Flow
  3. CIBA Flow
  4. Dynamic Client Registration

Web to Web Redirect Flow

Account Information Service Flow
  1. Execute the Token request endpoint present within the TPP Authorisation folder under AISP.
  2. Execute the
    Create Accounts Access Consent
    endpoint present within Account consents folder. Now the ConsentId will be generated. You can check the Consent status using the
    Get Accounts Access Consent
    endpoint.
  1. Navigate to “Authorization” tab of PSU Authorization folder > “PSU Token Request” endpoint. Scroll down and click the “Get new Access Token” button.
  1. A Popup appears, where the PSU flow can be performed. Enter the PSU credentials, Click LOG IN, Select the Accounts and Click CONFIRM Button.
  1. Authentication will get completed successfully and the PSU Token will be generated.
  1. Provide a name for the Token and Click “Use Token” button. Now Select the entire token that was generated and Click the "Set as Variable" option. Select
    PSU-Token
    in the dropdown that appears.
  1. Now we can execute the Accounts, Balances and all the remaining endpoints one by one.
Payment Initiation Flow
  1. Execute the Token request endpoint present within the TPP Authorisation folder under PISP.
  2. Execute the
    Create Payments Consent
    endpoint present within Payments endpoint. You can check the Consent status using the
    Get Payments Consent
    endpoint.
  3. Next Follow steps 3 to 6 in AISP. Use the
    PSU Token Request
    present within PISP folder.
  1. Execute the
    Create Payment Instruction
    and
    Get Payment By Id
    endpoints one by one.
  2. Please follow the same procedure for Refunds and Request to Pay.
LOG Flow (Letter of Guarantee)
  1. Execute the TPP Token request endpoint present within the TPP Authorisation folder under LOG.
  2. Execute the
    Create Letter Guarantee Consent
    endpoint present within Letter Guarantee Consent folder. Now the ConsentId will be generated. You can check the Consent status using the
    Get Letter Guarantee Consent
    endpoint.
  1. Execute the
    Patch Letter Guarantee Consent
    endpoint, based on the Subscription required.
  1. Next Follow the steps 3 to 6 in AISP. Use the
    PSU Token Request
    present within LOG folder.
  2. Execute the
    Initiate Letter of Guarantee
    and
    Retrieve Letter of Guarantee
    endpoints.

App to App Flow

  1. This flow requires a Sprint boot project jwe.zip to be running in your local machine. This will work the same way as an ASPSP and It is used to generate JWE. Please change CLIENT_ID, PSU_ID and Account details, if you are using another Client in Postman collection. Perform
    mvn install
    and run the project using
    mvn spring-boot:run
    command.
  2. Once the Sprint boot project has started, Execute the
    TPP Token Request
    endpoint present within App to App folder .
  1. Execute the
    Create Accounts Consent
    endpoint.
  1. Execute the
    Client Token Request
    endpoint.
  1. Execute the
    Create JWE
    endpoint. Now the JWE will be generated using the Spring-boot application.
  1. Go the Settings tab and Disable the "Automatically follow redirects" toggle. Next Execute the
    App-2-app call
    . This is just a redirection endpoint and the Response code must be 302. The Consent will now be authorised.
  1. Next Execute the
    PSU Token call
    . And Finally execute the
    Get Accounts
    endpoint.
  1. Follow the same process for PISP, by just updating the Client ID's in both Postman collection and Sprint boot project.

CIBA Flow

  1. To perform the CIBA flow,
    OIDC CIBA Grant Enabled
    toggle must be turned on in Keycloak, for the specific Client ID that is configured in the Postman Collection.
  1. Execute the
    TPP Token Request
    and
    Create Accounts Access Consent
    endpoints. Now the Consent ID will be in
    AwaitingAuthorisation
    status.
  1. Execute the
    Ciba Initiation
    endpoint. In the Ciba Initiation endpoints request body, the
    login_hint
    must be updated based on the PSU user, who was registered in the Core bank.
  1. Execute the
    Client Token Call
    endpoint
  1. Update the
    accountIds
    variable in the Postman Environment, with the Account ID value of the PSU User, that was provided in Step 3. Then Execute the
    Update Account Access Consent
    endpoint. Now the Consent will be Authorised using the token that was generated in Step 4.
  1. Execute the
    Ciba Callback
    endpoint.
  1. Execute the
    Ciba Token Request
    endpoint.
  1. Next you can execute the
    Get Accounts
    endpoint and the Account details will be fetched as expected.
  1. Follow the same procedure for LGSP, by just updating the Client ID in the
    TPP Token Request
    and
    Ciba
    endpoint.

DCR

  1. Execute the
    DCR
    endpoint present within
    Dynamic Client Registration
    folder. Once executed, Client will be registered successfully. Now we can use this Client in the further endpoints.
  1. Execute the

    TPP Token request
    endpoint present within the
    TPP Authorisation
    folder under DCR.

  2. Execute the

    Create Accounts Access Consent
    endpoint present within Account Access consents folder. Now the ConsentId will be generated. You can check the Consent status using the
    Get Accounts Access Consent
    endpoint.

  3. Next Follow the steps 3 to 6 in AISP, to complete the PSU Authorisation. Use the

    PSU Token Request
    present within DCR folder.

  4. Execute the Accounts endpoint one by one.

  5. Follow the same procedure for Payment and LOG endpoints, by providing the appropriate Scope value(payments and log) in the DCR endpoint to register the Client.

  6. Execute the

    Delete App
    endpoint to delete the App created.