[英]How to validate the SalesForce Consumer Key and Consumer Secret
We have a system, where we want to push the records (eg Contact, Account, Opportunity) from our system to SalesForce.我们有一个系统,我们希望将记录(例如联系人、客户、机会)从我们的系统推送到 SalesForce。
To achieve this, we have used ForceToolKit for .Net .为了实现这一点,我们在 .Net 中使用了ForceToolKit 。 We are successfully pushing the contact records from our system to Salesforce.
我们正在成功地将联系记录从我们的系统推送到 Salesforce。
First customer has to provide the consumer key and secret and upon providing these details, the user will be redirected to Salesforce login page for OAuth.第一个客户必须提供消费者密钥和秘密,在提供这些详细信息后,用户将被重定向到 Salesforce 登录页面以进行 OAuth。 We are storing the RefreshToken and it will be used at the time of Data push.
我们正在存储 RefreshToken,它将在数据推送时使用。
Here, if user provides incorrect consumer key, then it is redirecting to Salesforce login page and shows below message:在这里,如果用户提供了不正确的消费者密钥,则它会重定向到 Salesforce 登录页面并显示以下消息:
error=invalid_client_id&error_description=client%20identifier%20invalid错误=invalid_client_id&error_description=client%20identifier%20invalid
Now, we have to validate the Consumer key & secret before it redirects to Salesforce URL and check if it is valid or not.现在,我们必须在重定向到 Salesforce URL 之前验证消费者密钥和秘密,并检查它是否有效。
Can anyone help me on how to achieve this?谁能帮助我如何实现这一目标?
I understand your question so why the Error will be like mismatch of URL which you provided in Enpoint URL.我理解你的问题,所以为什么错误会像你在 Enpoint URL 中提供的 URL 不匹配。 This is first reson and next is consider the method post or get but main Reason is URL mis match intha URL you have to use request type.
这是第一个原因,接下来是考虑 post 或 get 方法,但主要原因是 URL 与 URL 不匹配,您必须使用请求类型。 And consumer key secret key and username password this are the maditory to get the access token.
和消费者密钥秘密密钥和用户名密码这是获取访问令牌的必要条件。
As Aleander said, it's the first wrong endpoint URL and you need to consider additional things.正如 Aleander 所说,这是第一个错误的端点 URL,您需要考虑其他事项。
Instance = login for Production, and test for the sandbox. Instance = 登录生产,并测试沙箱。
URL - https://<instance>.salesforce.com/services/oauth2/token
URL -
https://<instance>.salesforce.com/services/oauth2/token
Method - POST方法- POST
Params -参数 -
You can check similar details in the below link as well -您也可以在以下链接中查看类似的详细信息 -
Link - https://medium.com/@krissparks/postman-a-salesforce-rest-web-service-28edc0a69851链接 - https://medium.com/@krissparks/postman-a-salesforce-rest-web-service-28edc0a69851
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.