如果针对沙盒环境进行授权,授权URL是什么?

问题描述 投票:0回答:1

我想这是一个分为两部分的问题。

我正在使用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-2.0 salesforce salesforce-lightning
1个回答
0
投票

[如果您要在沙盒组织中验证身份,请在上面列出的所有OAuth端点中使用“ test.salesforce.com”代替“ login.salesforce.com”。

https://test.salesforce.com/services/oauth2/token
© www.soinside.com 2019 - 2024. All rights reserved.