【问题标题】:Cordova SAP Fiori Client - how to pass SSO Token to FLP URLCordova SAP Fiori 客户端 - 如何将 SSO 令牌传递给 FLP URL
【发布时间】:2017-04-01 14:10:06
【问题描述】:
我们已为 FLP 启用 SAML。启动 Android Cordova 应用程序(Fiori 客户端)时,我有 SSO 令牌(可用),试图将此令牌传递给 SAP Fiori 客户端中的 Fiori Launchpad URL。
我像下面这样自定义了 index.html,但它不起作用。 Cookie 未通过。
document.addEventListener("deviceready", function() {
if (sap && sap.AppUpdate) {
initializeAppUpdateListeners();
var ssotoken ="<ADERGEVTEMPERERRER>"
document.cookie = "CORPSSOTOKEN="+ssoToken+";domain=.corp.com;path=/";
}
}, false);
【问题讨论】:
标签:
android
cordova
cookies
single-sign-on
sap-fiori
【解决方案1】:
以下用于将 cookie 传递给 Fiori 客户端。
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// without this line the app crashes when we try to set a cookie
new XWalkView(this, this).onDestroy();
XWalkCookieManager cookieManager = new XWalkCookieManager();
// Note that the cookie must be a persistent cookie (ie: it must have an expiry), since the Kapsel plugins clear session cookies on startup (but after onCreate).
cookieManager.setCookie("<replace this with the Fiori launchpad URL>","testCookie=testCookieValue; Expires=Mon, 01-Dec-2036 19:29:56 GMT; Path=/; Secure;");
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}