KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to use OAuth authentication to get the Salesforce Authentication Token, so I referred wiki docs , but after getting authorization code, when I make a Post request with 5 required parameters, I'm getting following exception {"error":"invalid_grant","error_description":"authentication failure"} CODE 400 JSON = {"error":"invalid_grant","error_description":"authentication failure"} which is I guess a bad request. 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()); Kindly reply, if exception known?
Tags (comma-separated)
Save Edits
Cancel