2014-03-04 29 views
0

我試圖爲我的Worklight應用程序實現註銷功能。特別是桌面瀏覽器網頁環境。IBM Worklight 6.1 - 無法在Desktop Browser網頁環境中實現註銷功能

我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> 

到目前爲止,我已經使用工作燈客戶端API

WL.Client.logout("MyAppRealm", {onSuccess: WL.Client.reloadApp}); 
WL.Client.logout(null, {onSuccess: WL.Client.reloadApp}); 

嘗試,但圍繞「境界沒有定義」未使用的錯誤工作。任何人都可以請建議爲什麼我可能會看到「領域沒有定義」的錯誤?

另外還有一種不同的方式從用戶註銷我的應用程序(直接訪問會話?)。

+0

你說 「桌面應用程序」。你實際工作的環境是什麼? Worklight中唯一的桌面環境是Adobe AIR。這是你的環境嗎?也許你的意思是Windows Store應用程序? –

+0

另外,僅添加您的authenticationConfig.xml是不夠的;在您嘗試登錄和註銷的地方添加您的實際JS代碼。 –

+0

我使用的是desktopbrowser環境,這就是我稱之爲桌面應用程序的原因。 – vkislicins

回答

0

您正在使用的登錄模塊在Worklight框架(com.worklight.core.auth.ext.RDBMSLoginModule)中不再存在。有關如何使用登錄模塊

更多信息可以在這裏找到: http://www.ibm.com/developerworks/mobile/worklight/getting-started.html#security (查找基於表單的認證,適配器爲基礎的身份驗證和自定義身份驗證和登錄模塊)。

您也可以看看這裏: http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.dev.doc/dev/r_security_framework.html

+0

謝謝你的回答。你是什​​麼意思RDBMSLoginModule不再存在?根據Infocenter它存在。這裏是在您提供的鏈接之後的Worklight 6.1文檔中: http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.dev.doc/devref/ r_database_login_module.html – vkislicins

相關問題