You need to sign in to do that
Don't have an account?

Getting "error":"invalid_client","error_description":"invalid client credentials" while trying to get auth code
Hey
Getting "error":"invalid_client","error_description":"invalid client credentials" while trying to get auth code.
Done with the Permission setting and Ip address setting. Im able to generate auth code via curl call but not programatically.Please guide me
private Client client = JerseyClientBuilder.newClient();
private String clientId="3MVG9ZL0ppGP5UrBtzV375FzNEKv4M0YHXq47vVM8O3rYjXp1VkxmcTRA_mpzUYB6vtedwwGS.3AG6lsiIODA";
private String redirecturi="https://localhost:8080/test/xypress-web/";
private void makeAuthCodeRequest() {
String username="k**0009@gmail.com";
String password="*******";
String LoginInstance="'https://login.salesforce.com";
String apiVersion ="";
//String consumerKey="";
String secretKey="*********";
String granttype="password";
String jsonString="";
try {
PostMethod post = new PostMethod("https://login.salesforce.com/services/oauth2/token");
post.addParameter("grant_type",granttype);
post.addParameter("client_id",clientId);
post.addParameter("client_secret",secretKey);
post.addParameter("username",username);
post.addParameter("PASSWORD",password);
post.addParameter("redirect_uri",redirecturi);
HttpClient httpclient = new HttpClient();
httpclient.executeMethod(post);
String postResp = post.getResponseBodyAsString().toString();
} catch (Exception e) {
e.printStackTrace();
}
Getting "error":"invalid_client","error_description":"invalid client credentials" while trying to get auth code.
Done with the Permission setting and Ip address setting. Im able to generate auth code via curl call but not programatically.Please guide me
private Client client = JerseyClientBuilder.newClient();
private String clientId="3MVG9ZL0ppGP5UrBtzV375FzNEKv4M0YHXq47vVM8O3rYjXp1VkxmcTRA_mpzUYB6vtedwwGS.3AG6lsiIODA";
private String redirecturi="https://localhost:8080/test/xypress-web/";
private void makeAuthCodeRequest() {
String username="k**0009@gmail.com";
String password="*******";
String LoginInstance="'https://login.salesforce.com";
String apiVersion ="";
//String consumerKey="";
String secretKey="*********";
String granttype="password";
String jsonString="";
try {
PostMethod post = new PostMethod("https://login.salesforce.com/services/oauth2/token");
post.addParameter("grant_type",granttype);
post.addParameter("client_id",clientId);
post.addParameter("client_secret",secretKey);
post.addParameter("username",username);
post.addParameter("PASSWORD",password);
post.addParameter("redirect_uri",redirecturi);
HttpClient httpclient = new HttpClient();
httpclient.executeMethod(post);
String postResp = post.getResponseBodyAsString().toString();
} catch (Exception e) {
e.printStackTrace();
}