mule - Flow Vars getting lost after Facebook Authorize in MuleStudio -
i have simple flow authorize facebook , post message.
<flow name="drupal-esbflow2" doc:name="drupal-esbflow2"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" doc:name="http"/> <set-variable variablename="facebookmsg" value="#[message.inboundproperties['msg']]" doc:name="variable"/> <facebook:authorize config-ref="facebook" doc:name="authorize"/> <set-session-variable variablename="accesstokenid" value="#[flowvars['oauthaccesstokenid']]" doc:name="get oauthaccesstokenid"/> <facebook:publish-message config-ref="facebook" msg="#[flowvars['facebookmsg']]" profile_id="100001574667695" accesstokenid="#[sessionvars['accesstokenid']]" doc:name="publish message"/> <json:object-to-json-transformer doc:name="object json"/> </flow>
the idea want hit endpoint localhost:8082?msg=mymessage. want safe inboundproperties['msg'] in flow variable , use in facebook connector. seems variables gets lost in transport...
i have read known issue (mule facebook - flow variable), there no walk around or something?
well answer sort of alludes to, seems authorize mp intended called in complete isolation of other logic , return access token id via http:response-builder. client responsible sending access token id flow other processing:
<flow name="authorizationandauthenticationflow"> <http:inbound-endpoint host="localhost" port="8080" path="oauth-authorize"/> <facebook:authorize/> <http:response-builder status="200"> <http:set-cookie name="accesstokenid" value="#[flowvars['oauthaccesstokenid']]"/> <set-payload value="you have authorized connector. access token id #[flowvars['oauthaccesstokenid']]"/> </http:response-builder> </flow>
i can sort of see why, makes architect app in specific way.
the other options use "state" parameter. depends on on types of data you're in flow vars. example:
<facebook:authorize state="#[flowvars.myvalue]"/>
this returned in callback inbound property can retrieved via:
#[message.inboundproperties['state']]
etc.
alternatively @ persisting values, possibly in mule object-store.
Comments
Post a Comment