oauth - Mule Facebook Null Payload -
asked evaluate buying mulesoft - , produce demo connects facebook. following 2 samples here:
https://github.com/mulesoft/facebook-connector/blob/master/doc/sample.md , http://blogs.mulesoft.com/mule-school-integration-with-social-media-part-ii-%e2%80%93-facebook/
ran problem first sample - wouldn't compile because endpoint http connector same facebook connector. did research , made changes, error below , can't find else experienced same:
unable fetch access token. message payload of type: nullpayload
- on callback page. has experienced this?
here code:
<http:listener-config name="http_listener_configuration" host="localhost" port="8099" doc:name="http listener configuration"/> <facebook:config-with-oauth name="facebook-config" consumerkey="..." consumersecret="..." scope="user_photos" doc:name="facebook"> <facebook:oauth-callback-config domain="localhost" localport="8099" remoteport="8099" path="callback"/> </facebook:config-with-oauth> <http:listener-config name="http_listener_configuration1" host="localhost" port="8094" doc:name="http listener configuration"/> <flow name="authorize"> <http:listener config-ref="http_listener_configuration" path="/" doc:name="http"/> <facebook:authorize config-ref="facebook-config" doc:name="facebook"/> <set-session-variable variablename="accesstokenid" value="#[flowvars['oauthaccesstokenid']]" doc:name="save access token"/> <flow-ref name="photodownload" doc:name="call photo download"/> </flow> <flow name="photodownload"> <http:listener config-ref="http_listener_configuration1" path="/" doc:name="http"/> <not-filter doc:name="not"> <wildcard-filter pattern="/favicon.ico" casesensitive="false"/> </not-filter> <facebook:get-user-picture config-ref="facebook-config" user="me" accesstokenid="#[sessionvars['accesstokenid']]" doc:name="get profile picture"/> <file:outbound-endpoint path="c:\temp" outputpattern="profilepic.jpg" responsetimeout="10000" doc:name="save picture "/> <json:object-to-json-transformer doc:name="object json"/> </flow>
here stack trace:
error 2015-06-10 13:47:07,731 [[internalfacebook].http_listener_configuration.worker.01] org mule exception defaultmessagingexceptionstrategy: ******************************************************************************** message : unable fetch access token. message payload of type: nullpayload code : mule_error--2 -------------------------------------------------------------------------------- exception stack is: 1. unable find valid certification path requested target (sun.security.provider.certpath.suncertpathbuilderexception) sun.security.provider.certpath suncertpathbuilder:-1 (null) 2. pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target (sun.security.validator validatorexception) sun.security.validator pkixvalidator:-1 (null) 3. sun.security.validator validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target (javax net ssl sslhandshakeexception) sun security ssl alerts:-1 ( java.sun com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/sslhandshakeexception html) 4. error found while consuming http resource @ https(colonslashslash) graph facebook com/oauth/access_token (java.lang.runtimeexception) org.mule security oauth util httputilimpl:93 (null) 5. unable fetch access token. message payload of type: nullpayload (org mule api messagingexception) org.mule.security.oauth.processor.oauth2fetchaccesstokenmessageprocessor:95 ( wwwmulesoftrog docs site current3 apidocs org mule api messagingexception html) -------------------------------------------------------------------------------- root exception stack trace: sun.security.provider certpath suncertpathbuilderexception: unable find valid certification path requested target @ sun security provider certpath suncertpathbuilder enginebuild(unknown source) @ java.security cert certpathbuilder build(unknown source) @ sun.security validator pkixvalidator dobuild(unknown source) + 3 more (set debug level logging or '-dmule.verbose.exceptions=true' everything) ******************************************************************************** info 2015-06-10 13:47:08,183 [[internalfacebook].http_listener_configuration.worker.01] org mule module http internal listener httplistenerregistry: no listener found request: (get)/favicon ico info 2015-06-10 13:47:08,184 [[internalfacebook].http_listener_configuration.worker.01] org mule module http internal listener httplistenerregistry: available listeners are: [(*)/callback/, (*)/]
couple things might help. first off, make sure fb app , mule fb config match on "scope" ex. "email,public_profile,user_friends".
also, solved part of issue creating global http element callback. callback http path needs "/*". in authorization fb component under oauth tab, put callback http name http connector reference.
<facebook:oauth-callback-config domain="localhost" localport="5000" remoteport="5000" connector-ref="callback"></facebook:oauth-callback-config> </facebook:config-with-oauth> <http:listener-config name="callback" host="0.0.0.0" port="5000" basepath="/*" doc:name="http listener configuration" />
Comments
Post a Comment