Download following dependency jar files and put them into
Generate public and private keys using the following commands.
keytool -genkey -alias <myalias> -keyalg RSA -keystore <keystore-name>.jks keytool -export -alias <myalias> -file <filename> -keystore <keystore-name>.jks keytool -importkeystore -srckeystore <keystore-name>.jks -destkeystore myapp.p12 -deststoretype PKCS12 openssl pkcs12 -in myapp.p12 -nokeys -out myalias.pem openssl pkcs12 -in myapp.p12 -nodes -nocerts -out <private-key-name>.pem
If you have obtained the OBIE certificate when configuring DCR, use the certificate and keys to generate the keystore with the following commands.
Find the below descriptions for the parameters. Change them accordingly;
tpp.com.crt :Private certificate obtained from OBIE
tpp.com.key :Private keys
openssl pkcs12 -export -name tim -in tpp.com.crt -inkey tpp.com.key -out tim.p12 keytool -importkeystore -destkeystore keystore.jks -srckeystore tim.p12 -srcstoretype pkcs12 -alias tim
Create a sample application, subscribe to an API and generate production/sandbox keys. Open and provide the content between BEGIN CERTIFICATE and END CERTIFICATE of the
myalias.pemfile as the application certificate.
Create a directory named
jwtExtResourcesin a preferred location and place the
jks keystorefile created in the above steps.
[JMETER_HOME]/binpath and add the required properties. Example properties are as follows.
Code Block language bash
ip_address=<Enter your ip address here. Ex: 127.0.0.1> port=<Enter the specific http port here. Ex: 8280> https_port=<Enter the specific https port here.Ex: 8243> client_id=<Enter your client_id here. Ex: C5jcraWOnrqzBdvm2x0g6h8hcJAa> domain=<Enter your domain address here. Ex: openbanking.staging.wso2.com> result=<Enter the path to save the results here. Ex: /home/user/jmeter/apache-jmeter-3.2/bin/writedisabled/results> jwtExtResources=<Enter the path to jwtExtResources directory here. Ex: /home/user/jmeter/apache-jmeter-3.2/bin/jwtExtResources> redirecturl=<where the authorization flow is redirected to when creating the application> algorithm=<Enter the algorith as a new property> PS256
Update the global variable to read the
setup.propertiesfile by calling the variable in the format. e.g.,
Within the global variable, please set the values for the below properties based on published API's. This will ensure that each API call reads the API context, version and resource, path based on the configurations.
Create a file named
[JMETER_HOME]/bin/jwtExtResourcesdirectory with below details.
Code Block language bash
keyStorePassword=<Enter your key store password here. Ex.wso2carbon> keyStoreDomainName=<Enter alias name of the keystore here. Ex.myalias> clientID=<Enter application client ID here. Ex. nwU59qy9AsDqftmwLcfmkvOhvuYa> keyStoreName=<Enter KeyStore file name here. Ex.TodayApp.jks> tokenAPIURL=<Enter token endpoint URL which you have to use as aud value Ex. http://localhost:8280/token> Algorithm=<Enter algorithm details which JWT token need to be generated Ex. PS256>