ibm mobilefirst - LTPA token propagation from App to Adapter to final service -


i'm trying use , understand use of ltpa security in worklight , propagation of ltpa cookie.

i'm able authenticate agains , using sniffer can see worklight returns me ltpatoken2 cookie when invoke http adapter, invokes service in other in same machine worklight server, adapter not propagate cookies.

i think have set right configuration. (at end)

is possible configure worklight server automatically propagate ltpa token app adapters , adapters final service?

if not possible automatically how can retrieve ltpa cookie inside adapter code add headers parameter of wl.server.invokehttp() method.

this security configuration:

for work have had add login.html hand in customized war generated in worklight studio.

application-descriptor:

<ipad bundleid="xxxx" securitytest="bpmapp-strong-mobile-securitytest" version="1.0"> 

adapter-descriptor:

<procedure connectas="enduser" name="getrest" securitytest="bpmadapter-securitytest"/> 

security configuration:

<realm loginmodule="wasltpamodule" name="bpmauthrealm">      <classname>com.worklight.core.auth.ext.websphereformbasedauthenticator</classname>     <parameter name="login-page" value="/login.html"/>     <parameter name="error-page" value="/login.html"/>     <parameter name="cookie-name" value="ltpatoken2"/> </realm>  <loginmodule name="wasltpamodule" canberesourcelogin="true" isidentityassociationkey="false">     <classname>com.worklight.core.auth.ext.websphereloginmodule</classname> </loginmodule>  <mobilesecuritytest name="bpmapp-strong-mobile-securitytest">     <testuser realm="bpmauthrealm"/>     <testdeviceid provisioningtype="none"/> </mobilesecuritytest>  <customsecuritytest name="bpmadapter-securitytest">     <test isinternaluserid="true" realm="bpmauthrealm" isinternaldeviceid="true"/> </customsecuritytest> 

thank you.

i believe you're looking for:

function getcurrentuser() { path = '/snoop'; var attributes = wl.server.getactiveuser().attributes; var token = "ltpatoken=" + attributes.get('ltpatoken');  var input = {     method : 'get',     returnedcontenttype : 'html',     headers: {"cookie": token},     path : path };  return wl.server.invokehttp(input); 

}

this code snipped 5.0.3, think syntax may have changed getting token attributes object in newer versions.

you may need change:

var token = "ltpatoken=" + attributes.get('ltpatoken'); 

to:

var token = "ltpatoken=" + attributes['ltpatoken']; 

but idea. adapter not sending cookie upon subsequent requests, cookie available adapter through user's 'attributes' object. it's matter of getting cookie , adding header upon each adapter invocation.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -