相关疑难解决方法(0)

Salesforce身份验证失败

我正在尝试使用OAuth身份验证来获取Salesforce身份验证令牌,所以我提到了wiki文档,但在获得授权代码后,当我发出带有5个必需参数的Post请求时,我遇到了以下异常

{"error":"invalid_grant","error_description":"authentication failure"} CODE 400
JSON = {"error":"invalid_grant","error_description":"authentication failure"}
Run Code Online (Sandbox Code Playgroud)

这是一个糟糕的要求.

PostMethod post = new PostMethod("https://login.salesforce.com/services/oauth2/token");
post.addParameter("code",##############);
post.addParameter("grant_type","authorization_code");
post.addParameter("redirect_uri","#################");  
post.addParameter("client_id",this.client_id);
post.addParameter("client_secret",this.client_secret);
httpclient.executeMethod(post);
String responseBody = post.getResponseBodyAsString();
System.out.println(responseBody+" CODE "+post.getStatusCode());
Run Code Online (Sandbox Code Playgroud)

如果有例外,请回复

salesforce force.com oauth-2.0

55
推荐指数
6
解决办法
5万
查看次数

标签 统计

force.com ×1

oauth-2.0 ×1

salesforce ×1