You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 30
Next »
This document explains the flow of events related to the Consumer Data Standards API v1.0.0
Step 1 - Sign up as an Accredited Data Recipient
In this step, the Accredited Data Recipient (ADR) registers its application in WSO2 API store.
Click here to see how it is done...
Navigate to the API Store at https://:9443/store.
Select Sign-up on the top left corner of the homepage.
Provide the requested details on the signup page.
Click here for more information..
a. Generic details:
Field | Description |
---|
Username/Email | The username/email that the DR uses to sign in to the API Store. |
Password | The password that the DR uses to sign in to the API Store. |
Retype Password | This is to prevent the DR from accidentally setting an incorrect password. |
Last Name | This is the last name of the DR. |
First Name | This is the first name of the DR. |
b. Company details:
Field | Description |
---|
Legal Entity Name | The official name of the DR. |
Country of Registration | The country in which the DR is registered. |
Legal Identifier Number (LEI) | This identifies the DR. |
Company Register | The organization that registered the DR. |
Company Registration Number | Identifier issued at the DR registration. |
Address Line 1 | Address of the DR. |
Address Line 2 | Address of the DR. |
City | City in which the DR is located. |
Postal Code | Postal code of the geographical location of the DR. |
Country | The country in which the DR is located. |
c. Competent authority registration details:
Field | Description |
---|
Competent Authority | The regulatory body that authorises and supervises the open banking services delivered by the DR. |
Competent Authority Country | Country of the competent authority that authorised the DR to provide open banking services. |
Competent Authority Registration Number | The registration number issued by the Competent Authority to the DR. |
URL of the Competent Authority Register Page | URL of the page that has the list of organizations authorised by the competent authority. |
Read terms and conditions. Click the checkbox to agree to the terms and conditions.
Click Sign Up. A request to approve the DR sign up is now sent to the Approver users.
Step 2 - Approve the ADR
Now that you have signed up as an ADR, an admin who overlooks all ADR sign-up forms must approve it.
Click here to see how it is done...
Sign in to the WSO2 Open Banking API Manager Admin portal as an Approver at https://<WSO2_OB_APIM_HOST>:9443/admin.
Locate the approval request and click Assign To Me.
Click Start to start the approval process.
- Select Approve then Complete.
Now the DR can sign in to the API store.
Step 3 - Sign in to the API store as the ADR
Users can sign in to the API store and proceed with the steps mentioned below.
Click here to see how it is done...
Sign in to the API Store as the ADR at https://<WSO2_OB_APIM_HOST>:9443/store.
Click Sign In and navigate to the Sign In page.
Enter the username and the password you entered when signing up as an ADR.
Click Sign In.
The homepage of the API store is now displayed along with the APIs.
Step 4 - Create an application
The ADR with an application needs to create an application using WSO2 API store. The application created via WSO2 API store allows to observe statistics of APIs, subscribe to APIs, and access the subscribed APIs.
Click here to see how it is done...
Go to the Applications tab in the API Store.
Click Add Application.
Enter application details.
Field | Description |
---|
Name | Application name. |
Per Token Quota | Determines the maximum number of API requests accepted within a given duration. |
Description | This describes the purpose of the application. |
Click Add.
Step 5 - Subscribe to API
The ADR user needs to subscribe to the ConsumerDataStandards v1
API in order to access its API resources. Once subscribed, the users can access all the supported services of the API resources.
Click here to see how it is done...
Go to the APIs tab in the API Store.
Select the ConsumerDataStandards
v1
API.
Select the application you created in the Create an application section.
Set the Tiers
to Unlimited
.
Click Subscribe.
Now that you have subscribed to the API, generate access tokens and invoke the API.
Step 6 - Create certificates
The ADR user needs to create certificates to validate whether the ADR is registered in a gove
Click here to see how it is done...
A keystore file is used to store the trusted certificates of the ADR in the WSO2 Open Banking solution. Use the commands given below in a command-line interface in order to create a keystore file as an ADR.
Make sure to update the following placeholders:
<alias> | A preferred alias for the keystore file. |
---|
<filename> | A preferred name for the keystore file. |
---|
keytool -genkey -alias <alias> -keyalg RSA -keystore <filename>.jks
During the command execution, the ADR user requires to;
- Set a password for the keystore.
- Provide information, acquired when registering with a governing entity.
- Set a password for user-defined alias (<alias>).
Convert the keystore from the .jks format to .PKCS12. Make sure to update the following placeholders:
<keyStoreName> | This is the name of the <filename> , given above. |
---|
<PKCS12FileName> | This is the name of the keystore in the .PKCS12 format. |
---|
keytool -importkeystore -srckeystore <keystoreStoreName>.jks -destkeystore <PKCS12FileName>.p12 -deststoretype PKCS12
During the command execution, the ADR user requires to;
- Set a password for the destination keystore.
- Enter the source keystore password, as defined in the above step .
Create the application certificate (.pem) file in the PKCS12 format using the keystore. e.g: dr.p12.
Make sure to update the following placeholders:
<PKCS12FileName> | This is the name of the keystore in the PKCS12 format, as mentioned above for the <PKCS12FileName>. |
---|
<PEMFileName> | This is the name of the application certificate that is created in the .pem format. |
---|
openssl pkcs12 -in <PKCS12FileName>.p12 -nokeys -out <PEMFileName>.pem
During the command execution, the ADR user requires to;
- Set a password to import the .pem file.
Import the public key you extracted in the previous step to the truststore file.
Update the placeholder values and use the given command.
<alias> | The alias for the keystore file. |
---|
<PEMFileName> | The name of the application certificate that is created in the .pem format. |
---|
<truststoreFileName> | The name of the truststore file that you want to import the public key. |
---|
<password> | The keystore password of the truststore file. |
---|
keytool -import -alias <alias> -file <PEMFileName>.pem -keystore <truststoreFileName>.jks -storepass <password>
Step 7 - Generate keys
The ADR user requires a Client ID (Consumer Key) and a Client secret (Consumer Secret) to access the subscribed APIs.
Click here to see how it is done...
Sign in to the API store as an ADR user and go to the Applications tab.
Choose your application from the Application List and select either of the following:
Production Keys: Generates access tokens in the production environment.
Sandbox Keys: Generates access tokens in the sandbox environment.
Provide the requested information as defined below:
Field | Description |
---|
Grant Types | These determine the credentials that are used to generate the access token. Refresh Token: This is to renew an expired access token. Client Credential: This relates to the client credentials grant type and is applicable when consuming the API as an application. Code: This relates to the authorisation code grant type and is applicable when consuming the API as a user.
|
Callback URL | This is the URL used by the ADR to receive the authorisation code sent from the Data Holder (bank). The authorisation code can be used later to generate an OAuth2 access token. |
Application Certificate | This is the content between the BEGIN CERTIFICATE and END CERTIFICATE strings of the application certificate (.pem) that you created above. |
Click Request Access if you are generating production keys. If workflows are configured in the solution, it sends a request to Approver user to approve the token generation. Otherwise, it generates consumer key and consumer secret.
Click Generate Keys if you are generating sandbox keys. It generates consumer key and consumer secret.
Step 8 - Approve Production Key generation
This step includes instructions to an Approver user to review and approve a request to generate production keys for an appli
Click here to see how it is done...
Step 9 - Authorising account consents
The bank redirects the bank customer to authenticate and approve/deny application-provided consents.
Click here to see how it is done
Generate the request object by signing the following JSON payload using the supported algorithms.
Run the following in a browser to prompt the invocation of the authorize API. Make sure you update the placeholders with the relevant values:
You are directed to a login page. Log in with the credentials of a user that has a Subscriber
role.
If a secondary factor is required. For example, SMS OTP, provide the relevant values. Upon successful authentication, the user is redirected to the consent management page.
Upon providing consent, the consumer is redirected to the callback URL of the ADR with the authorization code.
Step 10 - Generate user access token
In this section, you will be generating an access token using the authorization code generated in the section above.
Click here to see how it is done
The client_assertion
is a JSON Web Token (JWT). Generate the client_assertion
by signing the following JSON payload using the supported algorithms:
Run the following cURL command in a command prompt to generate the access token as an ADR user. Use --cert
and --key
in the access token generation request, for Mutual TLS authentication.
curl -X POST \
https://<WSO2_OB_APIM_HOST>:8243/token \
-H 'Cache-Control: no-cache' -k \
-H 'Content-Type: application/x-www-form-urlencoded' \
--cert <TRANSPORT_PUBLIC_KEY_FILE_PATH> --key <TRANSPORT_PRIVATE_KEY_FILE_PATH> \
-d 'client_id=<APPLICATION_ID>&grant_type=authorization_code&code=<GENERATED_CODE>&redirect_uri=<APPLICATION_REDIRECT_URI>&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion=<CLIENT_ASSERTION>'
The response of the contains an access token and a refresh token as follows:
{
"access_token":"4f939510-4330-336a-a3d6-3cee7e9f50da",
"refresh_token":"cedd647f-cb01-3112-bfea-3a5eb61d05a8",
"scope":"bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read openid",
"id_token":"eyJ4NXQiOiJORFV3WldGbE16WmlZalV6WmpJeE5USTNZV0V4T0dWXmw",
"token_type":"Bearer",
"expires_in":3496
}
Step 11 - Invoke Consumer Data Standards API
This section shows how to invoke the endpoints in the ConsumerDataStandards
v1
API using a few samples. These requests use the access token generated in the step above .
GET /banking/accounts
The ADR is able to obtain a list of accounts that the consumer has authorised the ADR to access.
POST /banking/accounts/balances
The ADR is able to obtain balances for a specified list of accounts. The request body contains a list of account IDs to obtain balances for.