I am currently utilizing the IBM MFP Web SDK along with the provided code snippet to send challenges and manage responses from the IBM MobileFirst server. Everything functions properly when the server is up and running. However, I have encountered an issue where the failure handler does not get triggered in case of a connection failure. Despite this, the library does output "Host is not responsive" in the browser console.
onInit() {
this.authHandler = WL.Client.createSecurityCheckChallengeHandler(CHECK_NAME);
this.authHandler.handleChallenge = this.onChallenge;
this.authHandler.handleSuccess = this.onSuccess;
this.authHandler.handleFailure = this.onFailure;
};
onChallenge = () => {
// display the challenge form...
};
onSuccess = (data) => {
console.log(data)
};
onFailure = (error) => {
console.log(error.failure || error.errorMsg || 'Failed to login');
};
login(username: string, password: string): void {
let data = {
username: username,
password: password
};
this.authHandler.submitChallengeAnswer(data);
}