0

我正面臨與用戶會話有關的問題。我使用的是基於適配器的身份驗證,我用它來驗證用戶是否擁有來自Web服務的祕密數據。工作燈對所有用戶都具有相同的會話

例如,當user1登錄時,他獲取他自己的數據。現在當用戶2登錄時,他得到他自己的數據。但user1也獲取user2的數據。所以所有的用戶都得到最後登錄用戶的數據。

我試圖把這個connectAs="endUser",但我仍然面臨同樣的問題。 任何想法來解決這個問題。

實際上我有這個問題的相反的行爲: IBM Worklight 6.0 - Adapter with basic auth doesn't update auth header if client logs out/in

這是authenticationConfig.xml:

<securityTests> 
    <customSecurityTest name="AdapterSecurityTest"> 
     <test isInternalUserID="true" realm="AdapterAuthRealm" /> 
    </customSecurityTest> 

    <mobileSecurityTest name="PushSecurityTest"> 
     <testUser realm="AdapterAuthRealm"/> 
     <testDeviceId provisioningType="none"/> 
    </mobileSecurityTest> 

</securityTests> 


<realms> 
    <realm name="AdapterAuthRealm" loginModule="AdapterLoginModule"> 
     <className>com.worklight.integration.auth.AdapterAuthenticator</className> 
     <parameter name="login-function" value="MyAdapter.onAuthRequired" /> 
     <parameter name="logout-function" value="MyAdapter.onLogout" /> 
    </realm> 
</realms> 

<loginModules> 
    <loginModule name="AdapterLoginModule"> 
     <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className> 
    </loginModule> 
</loginModules> 
+1

您正在使用的worklight的版本是什麼?你能提供你的適配器描述符和實現嗎?每個用戶都在自己的設備上,還是兩個用戶使用相同的設備/瀏覽器? –

+0

我使用工作燈6.0.0.201307011446,這是適配器描述:'<連通> \t \t \t \t \t HTTP \t \t \t myserver.com \t \t \t \t \t \t \t \t \t <過程名稱= 「認證」 connectAs = 「終端用戶」/> \t <過程名稱= 「getSecretData」 securityTest = 「AdapterSecurityTest」/ >' –

回答

1

connectas終端用戶應該getsecretdata設置,不進行身份驗證。

+0

我試過了,但是我遇到了同樣的問題,我做了一些研究。我發現在使用WebSphere作爲部署服務器的情況下,我可能需要使用LTPA身份驗證更改身份驗證適配器!這樣對嗎 ? –

+0

如果您將WebSphere用作部署服務器,則基於LTPA的身份驗證可用,但這不是必需的。如何在適配器中進行身份驗證?如果一個標準的認證器(比如WebSphereFormBasedAuthenticator)能夠做到這一點,那麼你最好使用它,而不是在適配器中進行自己的認證。但僅僅因爲您在WebSphere上運行並不意味着您需要使用LTPA。你能否將你的authenticationConfig.xml添加到原始問題中?你在認證程序中做了什麼? –

+0

我編輯了問題 –

相關問題