【问题标题】:Salesforce OAuth authentication bad request errorSalesforce OAuth 身份验证错误请求错误
【发布时间】:2016-11-14 23:59:06
【问题描述】:

我正在尝试运行一个简单的示例来使用 Java 代码向 Salesforce 进行身份验证。

我遇到错误 - 400 Bad Request

我使用的登录网址是

https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=clienty_id&client_secret=client_secret&username=username&password=password

我也试过移除放大器和;

https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=clienty_id&client_secret=client_secret&username=username&password=password

但仍然收到相同的错误 400 错误请求。

【问题讨论】:

  • 记得使用POST,记得对参数值进行URLEncode。如果您仍然遇到问题,请发布您的代码。

标签: oauth salesforce


【解决方案1】:

您需要使用“POST”标注来尝试此调用。当您使用“GET”方法时,您会收到 400 bad request 问题。 要么 您错过了在密码末尾附加安全令牌

https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id={clientId}&client_secret={client_secret}&username={userName}&password={password}{securitytoken }

Method : POST

【讨论】:

    猜你喜欢
    • 2015-08-23
    • 2014-06-07
    • 2021-03-26
    • 2017-06-01
    • 2023-02-26
    • 2017-12-27
    • 2015-04-28
    • 2016-03-27
    相关资源
    最近更新 更多