MobileFirst 适配器 Cookie 政策

MobileFirst Adapter Cookie Policy

MobileFirst 适配器有一些令人困惑的地方,即 Cookie 策略。实际上我找不到任何文档详细说明每种 Cookie 策略的使用以及它与 connectAs 属性有何关系。 我有这个顾虑,因为每次我必须向第三方应用程序进行身份验证时,我在维护 Cookie 和第三方会话时遇到很多麻烦。

请问有没有人详细解释一下?

user documentation 中针对 HTTP 适配器的 connectionPolicy 元素所述,您应该阅读其特定 RFC 中的每个 cookiePolicy - 因为这些 cookie 策略是' IBM 的。它们是行业标准:

另见此处:What does the cookiePolicy adapter parameter do in Worklight 6.1+?

These cookies don't affect the JSESSIONID cookie returned by the application server to the client (mobile app). The policy relates to all the cookies returned by the backend server to Worklight, including JSESSIONID.

cookiePolicyconnectAs 属性没有直接关系。因为这个属性基本上会决定是所有会话都有一个 HttpClient,还是每个会话都有一个 HttpClient。

无论哪种情况,cookie 策略都会应用于适配器。

来自同一个问题:

... each adapter has a separate instance of an HttpClient, and so the cookiePolicy acts only within the scope of one adapter. Different adapters will not share cookies by configuration.

关于 connectAs 更详细:What does connectAs="endUser" actually do?