I am trying to use the Facebook connector to retrieve some user info in Mule like this:
<facebook:config-with-oauth name="FacebookGlobal" appId="xxx" appSecret="xxx" doc:name="Facebook" scope="email,user_about_me, user_birthday, user_activities, user_groups, user_interests, user_likes">
<facebook:oauth-callback-config domain="localhost" localPort="8000" remotePort="8000"/>
</facebook:config-with-oauth>
<flow name="FacebookAuthorize" doc:name="FacebookAuthorize">
<http:inbound-endpoint exchange-pattern="request-response" doc:name="HTTP" host="localhost" path="auth" port="8000"/>
<facebook:authorize config-ref="FacebookGlobal" doc:name="Authorize"/>
<set-session-variable doc:name="Save Access Token" value="#[flowVars['OAuthAccessTokenId']]" variableName="accessTokenId"/>
</flow>
<flow name="FacebookFlow1" doc:name="FacebookFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8000" doc:name="Callback"/>
<facebook:get-user config-ref="FacebookGlobal" user="me" doc:name="Facebook" accessTokenId="#[sessionVars['accessTokenId']]"/>
</flow>
The problem is that after the facebook:authorize operation in the FacebookAuthorize flow, the flow is interrupted and it goes automatically to the callback url specified in the oauth-callback-config. Therefore the OAuthAccessTokenID is never saved in the session variable and it cannot be used in the other flow. How does the Facebook Authorize operation exactly work?
Thanks.