Oauth 无法获取访问令牌mule<-&燃气轮机;销售人员

Oauth 无法获取访问令牌mule<-&燃气轮机;销售人员,oauth,mule,esb,Oauth,Mule,Esb,我被困在一件我认为很容易的事情上 我正在尝试设置一个Mule流来连接Salesforce并获取OAUTH令牌 <flow> <sfdc:config-with-oauth consumerKey="thatgirliscute" consumerSecret="nosheishOT" doc:name="Salesforce (OAuth)" name="Salesforce__OAuth_" connectionTimeout="10000" readTimeout="10

我被困在一件我认为很容易的事情上

我正在尝试设置一个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>
任何需要解决的问题都会有很大的帮助。谢谢

--编辑:我在一个公司防火墙后面-这重要吗?但我能够成功地使用Salesforce connector进行基本身份验证。只有OAuTH导致了一个问题

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

然后自动重定向到下面的URL,错误为“无法获取访问令牌”。在浏览器中,消息负载的类型为:String',控制台的内容如我上面所述


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

似乎是连接超时。增加超时时间,然后尝试是否抛出相同的错误。@star感谢您的评论-当前超时时间为1000秒。。但我还是在上面的配置中看到了这个错误,超时时间是
10000
毫秒,也就是
10
秒。。。防火墙不应该是一个问题,因为所有呼叫都是从内部到外部世界发起的。@DavidDossot我刚刚尝试增加超时秒数,现在收到了另一条消息。当我点击localhost:8081时,我被成功重定向到Salesforce授权页面,但在输入凭据后,我收到此错误消息“无法获取访问令牌”。消息负载的类型为:String',但根本原因是
连接超时:connect
如上所示,对吗?
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