【发布时间】:2015-09-21 11:32:54
【问题描述】:
我正在处理 Worklight 服务器的服务器会话超时问题。我在 worklight.properties 文件中设置了 serverSessionTimeout=5。我遵循了所有领域的 anf 身份验证过程。
服务器会话超时后,如何从适配器响应中知道会话已过期。
ChallengeHandler :
challengeHandler = WL.Client.createChallengeHandler("MyRealm");
challengeHandler.isCustomResponse = function(response) {
console.log("From chalange hanler");
console.log(response);
};
会话超时(5 分钟)后的适配器调用 -->
var invocationData = {
adapter: "Auth",
procedure: "testSession",
parameters: []
};
var options = {
onSuccess: function(res){
console.log("From test session");
console.log(res.invocationResult);
},
onFailure: function(res){},
};
WL.Client.invokeProcedure(invocationData, options);
适配器响应始终相同。
【问题讨论】:
-
我们在客户端使用 WL.Client.setHeartbeatInterval() api,如果客户端达到了我们指定的超时时间,那么我们发送一个会话超时的警报,我们路由用户到登录屏幕。
标签: ibm-mobilefirst session-timeout worklight-adapters worklight-server