0
IBM MFP Web SDKと以下のコードを使用して、チャレンジを提出し、IBM MobileFirstサーバーから応答を処理します。サーバーが利用可能なときにうまく動作します。問題は、障害ハンドラが接続に失敗した場合に呼び出されないことです。ライブラリはブラウザコンソールに "Host is not responsive"と表示されます。handleFailureはIBM MobileFirstクライアントで呼び出されませんか?
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);
}