我想这是一个分为两部分的问题。
我正在使用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
非常感谢您的帮助。
[如果您要在沙盒组织中验证身份,请在上面列出的所有OAuth端点中使用“ test.salesforce.com”代替“ login.salesforce.com”。
https://test.salesforce.com/services/oauth2/token