【发布时间】:2014-03-06 22:11:49
【问题描述】:
我正在尝试为我的 Worklight 应用程序实现注销功能。具体来说,桌面浏览器网页环境。
我的 authenticationConfig.xml 如下:
<resource id="MyApp" securityTest="MyAppTest">
<urlPatterns>/apps/services/www/MyApp/*</urlPatterns>
</resource>
<customSecurityTest name="MyAppTest">
<test realm="MyAppRealm" isInternalUserID="true"/>
</customSecurityTest>
<realm name="MyAppRealm" loginModule="MyAppLogin">
<className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
<parameter name="login-page" value="login.html" />
<onLoginUrl>/apps/services/www/MyApp/desktopbrowser/default/index.html</onLoginUrl>
</realm>
<loginModule name="MyAppLogin">
<className> com.worklight.core.auth.ext.RDBMSLoginModule </className>
<parameter name="dsJndiName" value="jdbc/myapp"/>
<parameter name="principalsQuery">
SELECT user_id, password, display_name FROM users WHERE user_id=?
</parameter>
</loginModule>
到目前为止,我已经尝试过使用 Worklight 客户端 API
WL.Client.logout("MyAppRealm", {onSuccess: WL.Client.reloadApp});
WL.Client.logout(null, {onSuccess: WL.Client.reloadApp});
但这不适用于“未定义领域”的错误。谁能建议我为什么会看到“未定义领域”错误?
或者,是否有其他方法可以让用户从我的应用中注销(直接访问会话?)。
【问题讨论】:
-
你说的是“桌面应用”。您实际在哪个环境中工作? Worklight 中唯一的桌面环境是 Adobe AIR。这是你的环境吗?也许您是指 Windows Store 应用?
-
另外,仅添加您的 authenticationConfig.xml 是不够的;在您尝试登录和注销的地方添加您的实际 JS 代码。
-
我使用的是桌面浏览器环境,所以我称之为桌面应用。
-
所以这基本上是 HTML/JS 存在于您的服务器上,并被获取并在您的浏览器上运行。谢谢。请参考我的第二个问题。
-
另外请告知您当前使用的 Worklight 版本。
标签: security browser ibm-mobilefirst