Step 3 - Handle MFA (if necessary)
Overview
There may be cases where an end user's FI requires an extra challenge to be completed to return data. In this case, you will need to be able to handle an MFA challenge and pass it onto your end user to complete.
Aerosync MFA Widget
Utilize the Aerosync MFA to handle the MFA challenge.
You can use the handleMFA
parameter in your Aerosync widget configuration to initiate the handling of the MFA challenge and user inputs.
Refer to the widget integration guides and your specified library for more information.
Sample Widget Configuration
Below is the sample code to launch the Aerosync widget and complete the MFA challenge. The required parameters are handleMFA, jobId and userId. You can just call the same method for initial bank linking and include those 3 parameters to launch the widget for MFA.
var handleMFA = true; // if true then handle the additional MFA workflow for balance refresh
var domain = ""; // Merchant host name eg: google.com
var jobId = ""; // Unique ID for current job
var userId = ""; // Unique ID for user
var widgetRef = new window.AerosyncConnect({
id: "widget",
iframeTitle: 'Connect',
environment: 'sandbox', // sandbox, production,
token: token,
style : {
width: '375px',
height: '688px',
bgColor: '#000000',
opacity: 0.7
},
deeplink: deeplink,
handleMFA: handleMFA,
domain: domain,
jobId: jobId,
userId: userId,
consumerId: consumerId,
onEvent: function (type, payload) {
console.log("onEvent", type, payload);
},
onLoad: function () {
console.log("onLoad");
},
onSuccess: function (event) {
console.log("onSuccess");
var successData = document.getElementById('wrapData');
successData.innerHTML = '';
successData.innerText = 'Success : ' + '\n' + JSON.stringify(event, null, 4);
},
onClose: function () {
console.log("onClose1");
},
onError: function (event) {
console.log("onError", event);
var errorData = document.getElementById('wrapData');
errorData.innerHTML = '';
errorData.innerText = 'Success : ' + '\n' + JSON.stringify(event, null, 4);
}
});
// launch widget to complete MFA
widgetRef.launch();
Demo
When Aerosync widget is launched with handleMFA, jobId and userId:
Widget redirects to MFA page to complete the challenge:
When user clicks on the continue button, Aerosync will initiate the process to verify the MFA challenge:
On successful verification, Aerosync will display the success page and on clicking the 'Continue' button will close the widget.
Updated about 1 month ago