Fre*_*tte 5 api rest curl salesforce
我正在尝试获取我的salesforcePartialbox的会话ID。
我的代码:
curl https://test.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=definitely the correct client id" -d "client_secret=definitely the correct client secret" -d "username=mymail@mail.com.partialbox" -d "password=passandsecuritytoken"
Run Code Online (Sandbox Code Playgroud)
我还做了什么:
我仍然遇到错误{"error":"invalid_grant","error_description":"authentication failure"}
。
我搜索了SF论坛和StackOverflow问题,但找不到任何解决方案。有人知道吗,这里还有什么问题?
小智 12
确保您已完成此步骤。
*应用程序 -> 管理连接的应用程序 -> (我的应用程序的名称) -> 编辑应用程序 -> OAuth 策略 然后将“允许的用户”设置为“所有用户可以自行授权”。
*管理应用程序->连接的应用程序->(我的应用程序的名称)然后将“IP放宽”设置为“放宽IP限制”。
尝试在启用 TLS 1.1 的情况下发出curl 请求
卷曲-v https://login.salesforce.com/services/oauth2/token -d“grant_type=password”-d“client_id=xxxxxxxxxxXXXXXXXXXX”-d“client_secret=123456789”-d“用户名=xx@abcd.com” -d“密码=xxxxxxxxxx”
我仍然很困惑,我不知道到底是怎么回事,但是我也遇到了同样的问题,可以通过执行以下操作“修复”它。
首先,放宽该应用程序的IP限制。
管理应用程序->关联的应用程序->(我的应用程序的名称)
然后将“ IP放松”设置为“放松IP限制”。
据我所知,我正在使用的沙盒应用程序中没有IP限制,但是我对此还不陌生,所以也许它们藏在某个地方。
第二,在看起来像您的curl命令中,我省略了安全性令牌,因此密码字段就是密码。
我真的不知道我是否已经解决了问题,但是我找回了访问令牌,而不是“ invalid_grant”错误。
我计划进行一些进一步的调查以弄清楚发生了什么,但是我想出了,当我有这个问题时,我将确保此答案在这里。
归档时间: |
|
查看次数: |
9292 次 |
最近记录: |