You need to sign in to do that
Don't have an account?
Yuriy Barannikov
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.
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.
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