+ Start a Discussion
Anshita JainAnshita Jain 

Username password authenication

Hello!
I have been trying to set up a username password Oauth following this link: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_username_password_oauth_flow.htm

I set up a connected app and use its appropraite cliend id and secret. 
I am sending an HTTP post request through a local login .net app I created. I am sending all the appropriate information. However, my app returns a System.Net.WebException error 404. I tried sending a post request through https://openidconnect.herokuapp.com/ . This link says that my URI is unavailable. The URI that I am sending the request to is https://login.salesforce.com/services/oauth2/token. When I send a post request through Postman, it says "invalid client credentials", even though I am sure I am giving the right salesforce login credentials. 

Is this URI not available anymore? What am I doing wrong? 
{!pramod_nishane}{!pramod_nishane}
HI Anshita,

For Postman request can you check -
1) Are you using Security Token along with password?
2) https://login.salesforce.com/services/oauth2/token - is there any domin enable for your org? If yes then try that, for example - 
https://pamdev-dev-ed.my.salesforce.com/services/oauth2/token

Please let me know in case of any concerns.

Please mark this answer as the solution/ best answer if it solves your purpose so that it can help other community members.

Thanks,
Pramod Nishane
Salesforce Consultant
Varasi LLC
www.varasi.com
Anshita JainAnshita Jain
I tried adding a security token along with my password on postman and I still get invalid client credentials! 
No, I dont have a domain for my org! 

What should I try next?
 
{!pramod_nishane}{!pramod_nishane}
Hi Anshita,

Then problem maybe with your salesforce app.
Can you share screen shot of your connected app if possible, it will help to get exact idea if there is anything missing.

Thanks,
Pramod Nishane
Salesforce Consultant
Varasi LLC
www.varasi.com
 
Anshita JainAnshita Jain
User-added image
here it is!!
I have made sure that I am copying and pasting the same exact client id and secret.
Also when I send a post request from postman, what is my callback url suppose to be? 
Anshita JainAnshita Jain
Thank you so much for your help!
{!pramod_nishane}{!pramod_nishane}
Hi Anshita,

There is no problem in your connected app.i am also wondering why it is not authenticating.

Thanks,
Pramod Nishane
Salesforce Consultant
Varasi LLC
www.varasi.com