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/.
Consent Expiry Listener
This is available only as a WSO2 Update and is effective from October 28, 2021 (10-28-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
WSO2 Open Banking provides an extension point to perform actions on the expiration of consents.
In order to engage the Consent Expiry Listener, you need to enable periodical_task_manager
and configure a consent expiry job. For more information, see Periodical TaskManager and CRON job service.
This extension point is a listener interface known as ConsentExpiryListener
and its Fully qualified pathname (FQN) is as follows:
com.wso2.finance.open.banking.task.manager.consent.expiry.job.ConsentExpiryListener
Use the following method available in the ConsentExpiryListener
class, which is invoked during a consent expiration:
void onExpiry(ConsentResource consentResource){ }
For example, if you implement a listener named DefaultConsentExpiryListener
:
public class DefaultConsentExpiryListener implements ConsentExpiryListener { @Override public void onExpiry(ConsentResource consentResource){ //write your logic here return; } }
Configurations
- Once implemented, build a JAR file for your listener project.
Place the above-created JAR file in the
<WSO2_OB_IAM_HOME>/repository/components/lib
directory.If it’s an OSGi JAR file, place it in the
<WSO2_OB_IAM_HOME>/repository/components/dropins
directory.- Configure the new listener as follows:
- Open the
<WSO2_OB_IAM_HOME>/repository/conf/deployment.toml
file. Add the following tags and configure the listener with its FQN. For example:
[open_banking.au] consent_expiry_listener = <FQN of listener implementation>
- Open the
- Save the above configurations and restart the Identity and Access Management server.