Extracting ltpa token from with portlet

516 views Asked by At

I have configured SSO using LTPA between Websphere Portal and Websphere Commerce and this is working fine.

I have a HTML portlet (Web Content Viewer based) with the following javascript ..

<script>
alert(getCookie('LtpaToken2'));
function getCookie(name) {
  var value = "; " + document.cookie;
  alert(document.cookie);
  var parts = value.split("; " + name + "=");
  if (parts.length == 2) return parts.pop().split(";").shift();
}
</script>

How come LTPA token is not present? Even though I can see it in the web console (network view)

The sequence of alerts show:

  1. DigestTracker=AAABSalkR30; 
    UnicaNIODID=LoLHPvCDf0C-Y2rOEEq; 
    mmid=162538914%7CMgAAAAr4jptRGwsAAA%3D%3D; 
    mmcore.pd=-1067100437%7CMgAAAAoBQviOm1EbC8RXPI0TAK+d8VIRy9FIAA0AAADOVKqv/bXRSAAAAAD/////AP//////////AAZEaXJlY3QBLwsJAAAACgABAAAAAAD///////////////8AAAAAAAFF;
    mmcore.srv=ldnvwcgus01; 
    IBM_W3SSO_ACCESS=w3-03.sso.ibm.com; ibmSurvey=1428952756135; 
    CoreM_State=19~-1~-1~-1~-1~3~3~5~3~3~7~7~|~~|~~|~~|~||||||~|~~|~~|~~|~~|~~|~~|~~|~;
    CoreM_State_Content=6~|~~|~|; 
    cookie_country_4LF=us; 
    mmcore.tst=0.676; 
    CoreID6=43553851578714150993122&ci=50200000|IBMTESTWWW_51040000|IBMTESTW3
    
  2. undefined

1

There are 1 answers

0
bobbyrne01 On BEST ANSWER

As Georgy mentioned, the cookie was set to HTTPOnly in WAS, which could be disabled under the Security settings.