无法获取访问令牌骡子<->销售人员



我被卡在一件我以为会很简单的事情上了

我正在尝试设置一个Mule流来连接Salesforce并获得OAUTH令牌。

<flow>
 <sfdc:config-with-oauth consumerKey="thatgirliscute" consumerSecret="nosheishOT" doc:name="Salesforce (OAuth)" name="Salesforce__OAuth_" connectionTimeout="10000" readTimeout="10000">
        <sfdc:oauth-callback-config domain="localhost" localPort="8081" path="callback"/>
    </sfdc:config-with-oauth>
    <flow name="salesforce-oauthFlow1" doc:name="salesforce-oauthFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
        <sfdc:authorize accessTokenUrl="https://login.salesforce.com/services/oauth2/token" authorizationUrl="https://login.salesforce.com/services/oauth2/authorize" config-ref="Salesforce__OAuth_" display="PAGE" doc:name="Authorize at Salesforce"/>
    </flow>

但是我得到一个错误消息说"无法获取访问令牌"。消息有效负载的类型为:String'

Message               : Unable to fetch access token. Message payload is of type: String
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Connection timed out: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Error found while consuming http resource at https://login.salesforce.com/services/oauth2/token (java.lang.RuntimeException)
  org.mule.security.oauth.util.HttpUtilImpl:93 (null)
3. Unable to fetch access token. Message payload is of type: String (org.mule.api.MessagingException)
  org.mule.security.oauth.processor.OAuth2FetchAccessTokenMessageProcessor:91 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.ConnectException: Connection timed out: connect

任何指针解析都有很大帮助。由于

——编辑:我在公司防火墙后面——这有关系吗?但我能够成功地使用Salesforce连接器进行基本身份验证。只有OAuTH导致了问题。

当我输入localhost:8081时,我被重定向到

https://ap1.salesforce.com/setup/secur/RemoteAccessAuthorizationPage.apexp?source=l86Hcy6qEKtWNqzXVErZDlmcRQs0D_HBE55Mqtm_Al6fTUPSfuQ%3D%3D&显示= page& sdtd = 1

然后自动重定向到下面的URL,错误是"无法获取访问令牌"。在浏览器中,消息有效负载的类型为:String',控制台的读取结果与我上面发布的一样。

http://localhost: 8081/回调?显示= page&代码= aPrxaSyVmC8fBbfefEfQB5xrKXrrRhK3DiVFrPu5ia0Q % 3 d % 3 d&状态= % 3 c % 3 cmule_event_id % 3 d0 - 546 - bdbb1 - 0095 - 11 - e5 - 9 -巴萨2 - c4138b080c9 % 3 e % 3 e

这是Mule中的一个bug, Salesforce Connector 6.2解决了这个问题。

最新更新