You need to sign in to do that
Don't have an account?
Carl Pierre
REST API Authentication failure
Hi, get this message following the steps provided here : https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_REST_API
So after getting the autorization code I trying to the access token and I have this message:
Error: call to token URL https://login.salesforce.com/services/oauth2/token failed with status 400, response {"error":"invalid_grant","error_description":"authentication failure"}, curl_error , curl_errno 0
I Have https url with a certificate.
I'm not able to find a support team or more info aobut the error
So after getting the autorization code I trying to the access token and I have this message:
Error: call to token URL https://login.salesforce.com/services/oauth2/token failed with status 400, response {"error":"invalid_grant","error_description":"authentication failure"}, curl_error , curl_errno 0
I Have https url with a certificate.
I'm not able to find a support team or more info aobut the error
I answered this one in below link
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000D7K3IAK
@Deepak Gulian
what sould I use as securitytoken? since I'm not able to get acces token.
array(
'grant_type' => 'password',
'client_id' => CLIENT_ID,
'client_secret' => CLIENT_SECRET,
'username' => 'kevin.xxx@cvent.com.devpro3',
'pasword' => $code,
);
You must append the user’s security token to their password A security token is an automatically-generated key from Salesforce. For example, if a user's password is mypassword, and their security token is XXXXXXXXXX, then the value provided for this parmeter must be mypasswordXXXXXXXXXX.
https://developer.salesforce.com/docs/atlas.en-us.200.0.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm
Thanks for your help but I tried this using my own credentials, I'm still getting authentication failure. :
Body='grant_type=password&client_id=3MVG9Y6d_Btp4xp6i7amMyRkpuMUTRLqeqNYTr036XK7YoDYXlaWbZgJ_kLWXSJJQvJX50olzBSiy6jZOh.8r&client_secret=1595478626856505123&username=username&password=passwordsecuritytoken';
Do you know if there a way to have more details about this error?
Thanks
Body ='grant_type=authorization_code&client_id=clientId&client_secret=clientSecret&redirect_uri=redirecturl&code=authorizationcode';
Replace:-
redirecturl = Redirect URL
clientId = Client ID
clientSecret = Client Secret
authorizationcode = Authorzation Code you recieved
This is my PHP code
This is the error message
Thanks for you support
Hello all, I have a packaged connected app, I am able to authenticate to salesforce through it successfully when I login to one client (using production salesforce), but when one of my clients tries to authenticate to it, they are getting the error you listed above.
One difference between the client that works and the client that doesn't is that the client that doesn't is using a sandbox environment.
This is the error I receive from the client that doesn't work. Below it I have included the options that I send to salesforce:
Response from Salesforce:
error: { error: 'invalid_grant', error_description: 'authentication failure' }
Request sent to Salesforce:
options: { method: 'POST', uri: 'https://login.salesforce.com/services/oauth2/token',
qs: {
grant_type: 'authorization_code', code: 'aPrxvJDqQzo3F9Zv2.JZUE6OKGkNgIyEElf.lmuggQAy6tg3C_xzrSzm9jDfuZqY_wU3KpeCBA==',
client_id: '****hidden*****',
client_secret: '****hidden*****',
redirect_uri: 'https://******/oauthcallback' },
headers: { Host: 'login.salesforce.com', 'content-type': 'application/x-www-form-urlencoded' }
Appreciate any guidance from the comunity.