You need to sign in to do that
Don't have an account?
Yuriy Barannikov
OAuth 2 auth error - invalid_grant
OAuth 2 error - invalid_grant
Hi guys,
Trying to authenticate using OAuth2.
GOT code successfully, but can't get access_token by code. Everytime receives invalid_grant - please see screnshot
What I am doing wrong, please suggest.
To see the screnshot please right-click on it and open in a new window.
Thank you in advance
Hi guys,
Trying to authenticate using OAuth2.
GOT code successfully, but can't get access_token by code. Everytime receives invalid_grant - please see screnshot
What I am doing wrong, please suggest.
To see the screnshot please right-click on it and open in a new window.
Thank you in advance
https://developer.salesforce.com/forums/?id=906F000000099liIAA
Also follow the flow explained in the below article
https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_oauth_web_server_flow.htm&language=en_US
Thank you for the reply.
Unfourtunatelly I had seen both articles you suggested
Regardging the first one:
I use OAuth2 with code and token and my error is not about Password:
{"error_description":"authentication failure","error":"invalid_grant"}
Regarging second one:
IP restrictions set to Relax. IP Relaxation: Relax IP restrictions
Please, any suggestions, I have no idea why it doesn't work.
Once again what I did:
-
Create account in salesforce
-
Create New App, get security id and secret to use in my WebApp
-
Send GET request to https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=%s&redirect_uri=%s
-
The request above redirects me to the login page, when I log in
-
Got the code in my app (for example: aPrxh1FYoyyqodpf8DsHwLC9jnfA5HkfzcnY3g2NsmnN3MXY1Vc7kdCE0eB4WzpxxiNQI_vklQ)
-
Send POST request to https://login.salesforce.com/services/oauth2/token with grant_type, client_id, client_secret, redirect_uri and code form parameters.
-
Receive HTTP 400 with JSON below:
{"error_description":"authentication failure","error":"invalid_grant"}Guys, please, tell me what am I doing wrong?
Yuriy