+ Start a Discussion
gs88834gs88834 

OAuth 2.0 invalid_grant error with grant_type = password

Hi, I'm running into an issue with getting an access token using a connected app with grant_type = password.  Here is my curl script:

curl https://test.salesforce.com/services/oauth2/token -H "Content-Type:application/x-www-form-urlencoded" -d "grant_type=password" -d "client_id=<my client_id>" -d "client_secret=<my client_secret>" -d "username=<myusername@domain.com>" -d "<my password+secret>"

I'm getting an invalid_grant error  "Authentication failure" 
 
Best Answer chosen by gs88834
SandhyaSandhya (Salesforce Developers) 
Hi,

Going to connected apps in Salesforce and changing 'permitted users' from 'Admin approved users are pre-authorized' to 'All users may self-authorize' 

Please refer below link step 9 which worked for others it may help you.

http://stackoverflow.com/questions/12794302/salesforce-authentication-failing

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution. 
 
Thanks and Regards
Sandhya

 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

Going to connected apps in Salesforce and changing 'permitted users' from 'Admin approved users are pre-authorized' to 'All users may self-authorize' 

Please refer below link step 9 which worked for others it may help you.

http://stackoverflow.com/questions/12794302/salesforce-authentication-failing

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution. 
 
Thanks and Regards
Sandhya

 
This was selected as the best answer
gs88834gs88834
Thanks you very much.  This solved my problem!
Love JeetLove Jeet
Awesome read...!!
Love Shayari (https://shayaritumse.in/love-hindi-shayari)
Love Jeet 6Love Jeet 6
One of the best blog I have ever read...Thanks!!

Valentines Day Quotes (https://sayingsmagazine.com/valentines-day-quotes)
love jeet 7love jeet 7
All these solutions are really great..!!

Romantic Good Morning Wishes (https://wishesmagazine.com/romantic-good-morning-wishes-for-gf-bf/)
 
kaushal sharma 24kaushal sharma 24
the
word to pdf (http://fastkpdf.com/" style="color:blue; text-decoration:underline)
age calculator (https://www.realagecalculator.com/" style="color:blue; text-decoration:underline)
insta fonts (http://fontsbrother.com/" style="color:blue; text-decoration:underline)
news (https://news.rklearnway.com/" style="color:blue; text-decoration:underline)
theme download (https://rktechworld.com/" style="color:blue; text-decoration:underline)
blogging (http://rklearnway.com/" style="color:blue; text-decoration:underline)
sarkari result (http://sarkariline.com/" style="color:blue; text-decoration:underline)
Sarkarifoam (http://sarkarifoam.com/" style="color:blue; text-decoration:underline)
Hindi network (https://hindinetworks.com/" style="color:blue; text-decoration:underline)
Hindi gk (https://hindi-gk.info/" style="color:blue; text-decoration:underline)

word to pdf (http://fastkpdf.com/" style="color:blue; text-decoration:underline)
age calculator (https://www.realagecalculator.com/" style="color:blue; text-decoration:underline)
insta fonts (http://fontsbrother.com/" style="color:blue; text-decoration:underline)
news (https://news.rklearnway.com/" style="color:blue; text-decoration:underline)
theme download (https://rktechworld.com/" style="color:blue; text-decoration:underline)
blogging (http://rklearnway.com/" style="color:blue; text-decoration:underline)
sarkari result (http://sarkariline.com/" style="color:blue; text-decoration:underline)
Sarkarifoam (http://sarkarifoam.com/" style="color:blue; text-decoration:underline)
Hindi network (https://hindinetworks.com/" style="color:blue; text-decoration:underline)
Hindi gk (https://hindi-gk.info/" style="color:blue; text-decoration:underline)

word to pdf (http://fastkpdf.com/" style="color:blue; text-decoration:underline)
age calculator (https://www.realagecalculator.com/" style="color:blue; text-decoration:underline)
insta fonts (http://fontsbrother.com/" style="color:blue; text-decoration:underline)
news (https://news.rklearnway.com/" style="color:blue; text-decoration:underline)
theme download (https://rktechworld.com/" style="color:blue; text-decoration:underline)
blogging (http://rklearnway.com/" style="color:blue; text-decoration:underline)
sarkari result (http://sarkariline.com/" style="color:blue; text-decoration:underline)
Sarkarifoam (http://sarkarifoam.com/" style="color:blue; text-decoration:underline)
Hindi network (https://hindinetworks.com/" style="color:blue; text-decoration:underline)
Hindi gk (https://hindi-gk.info/" style="color:blue; text-decoration:underline)

word to pdf (http://fastkpdf.com/" style="color:blue; text-decoration:underline)
age calculator (https://www.realagecalculator.com/" style="color:blue; text-decoration:underline)
insta fonts (http://fontsbrother.com/" style="color:blue; text-decoration:underline)
news (https://news.rklearnway.com/" style="color:blue; text-decoration:underline)
theme download (https://rktechworld.com/" style="color:blue; text-decoration:underline)
blogging (http://rklearnway.com/" style="color:blue; text-decoration:underline)
sarkari result (http://sarkariline.com/" style="color:blue; text-decoration:underline)
Sarkarifoam (http://sarkarifoam.com/" style="color:blue; text-decoration:underline)
Hindi network (https://hindinetworks.com/" style="color:blue; text-decoration:underline)
Hindi gk (https://hindi-gk.info/" style="color:blue; text-decoration:underline)

word to pdfword to pdfword to pdfword to pdfword to pdf (http://fastkpdf.com/" style="color:blue; text-decoration:underline)
aostv appaostv app
Everything is very open and very clear explanation for step by step keep moving, waiting for more updates, thank you for sharing with us. and follow below link for more info on https://developer.salesforce.com/forums?id=906F0000000BMODIA4&feedtype=SINGLE_QUESTION_DETAIL&dc=Formulas_Validation_Rules_Discussion&criteria=BESTANSWERS
https://aostv.xyz/ (http://aostv.xyz)