0

We have enabled SAML to our FLP. I have SSO Token (available) when Android Cordova App (Fiori Client) is launched, trying to pass this token to Fiori Launchpad URL in SAP Fiori Client. I customized index.html like below but it is not working. The Cookie is not being passed.

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


            }
        }, false);
Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170

1 Answers1

0

The below one worked for passing the cookie to the Fiori Client.

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);
}

}