我試圖通過Mule構建非常簡單的應用程序來連接到Facebook。 我跟着這個演示:enter link description hereMule Facebook連接器錯誤:「無法提取OAuth驗證程序」。
的問題,一旦我運行應用程序並點擊網址:http://localhost:1111/auth 我在瀏覽器中以下消息:
Could not extract OAuth verifier.
而且我得到以下錯誤在控制檯:
Root Exception stack trace:
org.mule.security.oauth.exception.AuthorizationCodeNotFoundException
at org.mule.security.oauth.processor.ExtractAuthorizationCodeMessageProcessor.extractAuthorizationCode(ExtractAuthorizationCodeMessageProcessor.java:56)
at org.mule.security.oauth.processor.ExtractAuthorizationCodeMessageProcessor.process(ExtractAuthorizationCodeMessageProcessor.java:39)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
完整的XML配置
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:facebook="http://www.mulesoft.org/schema/mule/facebook" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/facebook http://www.mulesoft.org/schema/mule/facebook/current/mule-facebook.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<http:listener-config name="HTTP_Listener_Configuration1111" host="localhost" port="1111" doc:name="HTTP Listener Configuration"/>
<facebook:config-with-oauth name="Facebook" consumerKey="111974699389920" consumerSecret="7406759445e528542668752d135c422a" doc:name="Facebook">
<facebook:oauth-callback-config domain="localhost" localPort="1111" remotePort="1111" path="/*"/>
</facebook:config-with-oauth>
<flow name="facebookFlow">
<http:listener config-ref="HTTP_Listener_Configuration1111" path="/auth" doc:name="HTTP"/>
<facebook:authorize config-ref="Facebook" doc:name="Facebook"/>
<choice doc:name="Choice">
<when expression="#[flowVars.OAuthAccessTokenId != null]">
<logger level="INFO" doc:name="Logger" message="Authorization is done succefully"/>
<set-payload doc:name="Set Payload" value="Facebook Authorization Successful"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</when>
<otherwise>
<logger level="INFO" doc:name="Logger" message="Authorization Failed"/>
<set-payload doc:name="Set Payload" value="Facebook Authorization Failed"/>
</otherwise>
</choice>
</flow>
</mule>
這是什麼問題的原因?如何避免它?
如果我理解正確,我應該打http:// localhost:1111我試過但沒有任何更改,仍然得到「無法提取OAuth驗證程序」。 –