2016-11-17 82 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); 
} 

}

相關問題