Ibm mobilefirst 基于IBM worklight适配器的身份验证

Ibm mobilefirst 基于IBM worklight适配器的身份验证,ibm-mobilefirst,worklight-adapters,worklight-server,worklight-security,Ibm Mobilefirst,Worklight Adapters,Worklight Server,Worklight Security,我跟着 这对我很有用。在这三个适配器中,我有三个适配器。我对所有过程使用相同的安全测试域。在我提供的特定超时之后,适配器返回我登录失败,这是正确的。但我在应用程序超时后出现以下错误- 控制台错误-身份验证\错误,错误消息:使用loginModule AdapterAuthLoginModule执行身份验证时出错,用户标识不可用 应用程序错误-handler.handleFailure不是函数 我无法获取worklight.js中的上述错误 是什么导致了这个错误?我想在超时后调用注销函数。但由于上

我跟着

这对我很有用。在这三个适配器中,我有三个适配器。我对所有过程使用相同的安全测试域。在我提供的特定超时之后,适配器返回我登录失败,这是正确的。但我在应用程序超时后出现以下错误-

控制台错误-身份验证\错误,错误消息:使用loginModule AdapterAuthLoginModule执行身份验证时出错,用户标识不可用

应用程序错误-handler.handleFailure不是函数

我无法获取worklight.js中的上述错误

是什么导致了这个错误?我想在超时后调用注销函数。但由于上述错误,我不能打电话

adapter.xml

<wl:adapter xmlns:wl="http://www.worklight.com/integration" xmlns:http="http://www.worklight.com/integration/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="AuthenticationAdapter">

<displayName>AuthenticationAdapter</displayName>
<description>AuthenticationAdapter</description>
<connectivity>
    <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
        <protocol>http</protocol>
        <domain>rss.cnn.com</domain>
        <port>80</port> 

    </connectionPolicy>
    <loadConstraints maxConcurrentConnectionsPerNode="2"/>
</connectivity>

<procedure name="submitAuthentication"/>
<procedure name="getSecretData" securityTest="AuthenticationAdapter-securityTest"/>

</wl:adapter>

在伊丹·阿达尔的帮助下,我找到了解决办法

我将下面的函数放在AdapterAuthRealMcChallengeHandler.js中

adapterAuthRealmChallengeHandler.handleFailure = function(response) {

    adapterAuthRealmChallengeHandler.startChallengeHandling();

};

调用上述函数后,在adapterAuthRealmChallengeHandler.handleChallenge中,我检查了成功登录后设置的标志值

你能提供你的适配器XML文件和挑战处理程序实现吗?@IdanAdar hi我已经更新了。。。adapter.xml和质询处理程序js文件。我已经在其他适配器中使用了该安全测试。登录有效,但在超时后,我没有收到上述错误。您在哪里声明“CurrentSessionId”?首先,尝试使您的提交身份验证方法受以下保护:
securityTest=“wl\u unprotected”
。其次,不太清楚什么是
window.location.hash=“#logout”
是(以及为什么即使在执行submitsuccess时也会出现这种情况),或者什么是
CurrentSessionId
。@IdanAdar CurrentSessionId是我的全局变量,它是在我的登录方法之后得到的。。当该方法获得成功时,我称之为submitAuthentication方法。
adapterAuthRealmChallengeHandler.handleFailure = function(response) {

    adapterAuthRealmChallengeHandler.startChallengeHandling();

};