Worklight でアダプター・ベースの認証を作成しようとしています。レルム、セキュリティ テスト、およびログイン モジュールを authenticationConfig ファイルに追加しました。IBM が提供するモジュールに従ってみました。WL.Server.setActiveUser メソッドの正確な構文とハードコードされた値をコピーしました。しかし、引き続きエラーが発生します。このメソッドを使用できる特定の範囲はありますか? 誰かが私のエラーがどこにあるかを見たり知っていますか?
次のエラーが引き続き発生します。
LOG: Request [login]
LOG: Request [/apps/services/api/GPC2/android/query]
LOG: response [/apps/services/api/GPC2/android/query] success: /*-secure-
{"responseID":"1","isSuccessful":true,"resultSet REMOVED LINE THAT CONTAINED DB RESULTS FOR SECURITY
[/apps/services/api/GPC2/android/query] exception.
SCRIPT5007: Unable to get value of the property 'setActiveUser': object is null or undefined
var lname= responseData.invocationResult.resultSet[0].somelastname;
var gpcid = responseData.invocationResult.resultSet[0].someid;
var fname = responseData.invocationResult.resultSet[0].somefname;
WL.Logger.debug("Login :: SUCCESS" + lname + " " + gpcid + " " + fname); //this line does write the values to the log
//WL.Client.login("NotificationsRealm");
WL.Server.setActiveUser ("NotificationsRealm", {
userId: gpcid,
displayName: fname,
attributes: {
firstName: fname,
lastName : lname,
isUserAuthenticated: 1,
}
});