You need to sign in to do that
Don't have an account?

REST API, "authentication failure" with user&password authentication
Hello.
I'm trying to integrate Salesforce into my application and i decided to use REST API and user&password authorization. I registered developer account, connected an application with enabled OAuth settings.
It's my settings:
Unfortunelly, i receive "{"error_description":"authentication failure","error":"invalid_grant"}" each time when i do authorization. It's example of my calling:
Here are my selected scopes:
Access your basic information (id, profile, email, address, phone)
Access and manage your data (api)
Provide access to your data via the Web (web)
Full access (full)
Access and manage your Chatter data (chatter_api)
Provide access to custom applications (visualforce)
Perform requests on your behalf at any time (refresh_token, offline_access)
Allow access to your unique identifier (openid)
Access custom permissions (custom_permissions
Callback URL is just "https://login.salesforce.com/services/oauth2/authorize"
Could you please help me to understand what i'm doing wrong? I ebabled all policies, my user(who i'm trying to log in) is superadmin of this account. Thank you!
I'm trying to integrate Salesforce into my application and i decided to use REST API and user&password authorization. I registered developer account, connected an application with enabled OAuth settings.
It's my settings:
Unfortunelly, i receive "{"error_description":"authentication failure","error":"invalid_grant"}" each time when i do authorization. It's example of my calling:
curl https://test.salesforce.com//services/oauth2/token -d "grant_type=password&client_id=CONSUMERKEY&client_secret=CONSUMERSECRET&username=yuriy%40example.com&password=passwordTOKEN"
Here are my selected scopes:
Access your basic information (id, profile, email, address, phone)
Access and manage your data (api)
Provide access to your data via the Web (web)
Full access (full)
Access and manage your Chatter data (chatter_api)
Provide access to custom applications (visualforce)
Perform requests on your behalf at any time (refresh_token, offline_access)
Allow access to your unique identifier (openid)
Access custom permissions (custom_permissions
Callback URL is just "https://login.salesforce.com/services/oauth2/authorize"
Could you please help me to understand what i'm doing wrong? I ebabled all policies, my user(who i'm trying to log in) is superadmin of this account. Thank you!
They should refer to the same instance.
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker
All Answers
They should refer to the same instance.
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker
As you said you are using developer account you need to add security token in your password. after that it should work.
Here is a sample code from PHP
Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
But uhmm... it works but i don't understand: callback URL is just url which will be used in Oauth2 authroization. It might be, i dunno, my-super-software.com/callback or localhost:3000/salesforce/callback. Ok, anyway it works now. It will be better if i don't try to understand this enterprise software.