Skip to main content

Consent Manage

You're reading Open Banking 3.0.0. The newest release is 4.0.0. Go to the newest release

WSO2 Open Banking Accelerator consists of endpoints to manage consents. You can customize relevant components according to your requirements using the extension points available. This section explains the Consent Manage component and how to customize the /manage endpoint.

The Consent Manage component processes requests based on specification requirements. The extension point of this component is the ConsentManageHandler interface. It contains methods that support HTTP GET, POST, DELETE, PUT, and PATCH methods. The interface also contains ConsentManageData object that holds data related to the request. Given below is a summary of details related to this extension.

Endpoint​

https://<IS_HOST>:9446/api/openbanking/consent/manage/{custom-path}

Interface​

com.wso2.openbanking.accelerator.consent.extensions.manage.model.ConsentManageHandler

Methods​

The following methods are available in the interface.

public void handleGet(ConsentManageData consentManageData) throws ConsentException;
public void handlePost(ConsentManageData consentManageData) throws ConsentException;
public void handleDelete(ConsentManageData consentManageData) throws ConsentException;
public void handlePut(ConsentManageData consentManageData) throws ConsentException;
public void handlePatch(ConsentManageData consentManageData) throws ConsentException;
default void handleFileUploadPost(ConsentManageData consentManageData) throws ConsentException {

throw new ConsentException(ResponseStatus.METHOD_NOT_ALLOWED, "File upload is not supported");
}
default void handleFileGet(ConsentManageData consentManageData) throws ConsentException {

throw new ConsentException(ResponseStatus.METHOD_NOT_ALLOWED, "File retrieval is not supported");
}
note

The handleFileUploadPost and handleFileGet methods above are only available as a WSO2 Update from WSO2 Open Banking Identity Server Accelerator Level 3.0.0.12 onwards. For more information on updating WSO2 Open Banking, see Updating WSO2 Products.

Error Handling​

In any of the consent extensions, if an error scenario occurs and you need to send an error response make sure to throw a ConsentException.

Data​

The following table explains the data available in ConsentManageHandler.

NameTypeDescription
headersMap<String, String>The request headers received in the request.
payloadObjectThe payload of the client request. This can either be a JSONObject or a JSONArray instance.
queryParamsMapThe query parameters received in the request as a Map.
requestPathStringThe request path to invoke the endpoint. This is the {custom-path} part mentioned above.
clientIdStringThe client ID of the application that made the request. This application is bound to the request from the gateway insequence based on the token used.
requestHttpServletRequestThe original HTTP servlet request. Use this to extract any other properties from the request.
responseHttpServletResponseThe HTTP servlet response object. If required, you can make any changes to this.
responseStatusResponseStatusThe status of the response that needs to be sent out regarding the current request.
responsePayloadObjectThe payload of the response that needs to be sent out regarding the current request. This should generally be a JSONObject.

Configuration​

To configure the customized Consent Manage component, follow the steps below:

  1. Open the <IS_HOME>/repository/conf/deployment.toml file.

  2. Locate the following tag and configure it with the customized component.

    [open_banking.consent.manage]
    handler="com.wso2.openbanking.accelerator.consent.extensions.manage.impl.DefaultConsentManageHandler"

Was this page helpful?