Can't setup SalesForce OAuth for a week with the same error. Don't have any idea anymore :(
What I did:
- Create account in salesforce
- Create New App, get security key 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
- 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? When I use PostMan google plugin with all my credentials all works fine, but when I do requests locally - receive error: {"error_description":"authentication failure","error":"invalid_grant"}
IP relaxation set to Relax IP restrictions callback_uri is with HTTPS
May it be that my IP blocked by SalesForce? Have no idea except this :(