【问题标题】:"error":"invalid_grant","error_description":"invalid authorization code" in salesforce销售队伍中的“错误”:“无效授权”,“错误描述”:“无效的授权代码”
【发布时间】:2018-08-30 16:24:08
【问题描述】:

我已经为“OAuth”设置了我的“Salesfore”连接应用程序,我可以使用它来验证用户身份。对于后续请求,我正在尝试获取访问令牌,因此将值发布到 Salesforce,如下所示。

$.post("https://login.salesforce.com/services/oauth2/token",
                {
                    "grant_type": "authorization_code",
                    "code": "00DXXXX5",
                    "client_id": "3MVXXXXK",
                    "client_secret": "15XXXX4",
                    "redirect_uri": "https://mysit11e.com/SalesforceCallback.aspx"
                });

但不幸的是我遇到了错误

"error":"invalid_grant","error_description":"无效的授权码"

我已确保代码中不存在 % 符号,因此将 %21 替换为 !

我还应该怎么做才能让它工作。

【问题讨论】:

  • 我现在正在这样做,我从哪里获得“代码”值。谢谢

标签: asp.net oauth oauth-2.0 salesforce


【解决方案1】:

您似乎将其发布为 json 尝试将其发布为请求字符串

grant_type=authorization_code&code=00DXXXX5&client_id=3MVXXXXK&client_secret=15XXXX4&redirect_uri=https://mysit11e.com/SalesforceCallback.aspx

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-17
    • 1970-01-01
    相关资源
    最近更新 更多