2016-11-17 43 views
0

我们已启用SAML加入我们的FLP。当Android Cordova App(Fiori Client)启动时,我有SSO Token(可用),试图将此令牌传递给SAP Fiori Client中的Fiori Launchpad URL。 我自定义index.html如下所示,但它不起作用。 Cookie未被传递。Cordova SAP Fiori客户端 - 如何将SSO令牌传递给FLP URL

document.addEventListener("deviceready", function() { 
      if (sap && sap.AppUpdate) { 
       initializeAppUpdateListeners(); 
       var ssotoken ="<ADERGEVTEMPERERRER>" 
    document.cookie = "CORPSSOTOKEN="+ssoToken+";domain=.corp.com;path=/"; 


      } 
     }, false); 

回答

0

下面的工作将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); 
} 

}

相关问题