我想这是一个由两部分组成的问题。
我正在使用 Postman 来测试我在 Salesforce 沙盒环境中设置的连接应用程序。我应该将请求发送到 https://login.salesforce.com/services/oauth2/token 还是 https://xxx--partial.lightning.force.com/services/oauth2/token",这是我们的沙盒?
当我向 https://login.salesforce.com/services/oauth2/token 发送请求时,我收到一个"Invalid_grant"错误,并带有"身份验证失败"的描述。如果我将 url 更改为"https://xxx--partial.lightning.force.com/services/oauth2/token",这是我们的沙箱,我会收到一个"invalid_request"错误,描述为"必须使用 HTTP POST"。以下是带有参数的网址:https://xxx--partial.lightning.force.com/services/oauth2/token?grant_type=password&client_id=clientIdHere &client_secret=clientSecretHere&username=myEmailAddress&password=myPassword&Content-Type=application/x-www-form-urlencoded
任何帮助将不胜感激。
还张贴在这里 : https://salesforce.stackexchange.com/questions/307644/what-is-the-authorization-url-if-authorizing-against-a-sandbox-environment
如果要在沙盒组织上验证身份验证,请在上面列出的所有 OAuth 终端节点中使用"test.salesforce.com"而不是"login.salesforce.com"。
https://test.salesforce.com/services/oauth2/token