function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC consultant integratiSFDC consultant integrati 

error invalid_grant , authentication failure.

i am failed to login to salesforce through api
I am getting error invalid_grant , authentication failure.
Vasani ParthVasani Parth
First, log into salesforce and view that user's record.  Look for the login history related list and see if that gives you any more details on why the authentication is failing.

Also, does the user have the API permission enabled?

Otherwise, verify the username (and password security token) are correct.  (PasswordSecurityToken is all one string, no + or space in between, if that helps)

Please mark this as the best answer if this helps
Is there an IP restriction or Login Hour restriction for the account your are trying ?
Prasad RaghavendraPrasad Raghavendra
@Vasani Parth
"PasswordSecurityToken is all one string, no + or space in between, if that helps"
This actually saved hours of my efforts. I was reading some blog and that person had used +. I removed it and it is working really well.