+ Start a Discussion
Vladimir BessonovVladimir Bessonov 

get access token

Hi. I am trying to get an access token for working with API

I always get the message 

{"error":"invalid_grant","error_description":"authentication failure"}*

I tried postman and curl 
curl -v https://login.salesforce.com/services/oauth2/token 
      -d "grant_type=password" -d "client_id=consumer_key" 
      -d "client_secret=consumer_secret" 
      -d "username=username" -d "password=password"

curl I repeat instruction from https://developer.salesforce.com/docs/atlas.en-us.api_iot.meta/api_iot/qs_auth_access_token.htm, but it still doesn't work 

what is wrong here? 
AbhishekAbhishek (Salesforce Developers) 

First, relax IP restrictions for the app.

Manage Apps -> Connected Apps -> (The name of my app)

Then setting "IP Relaxation" to "Relax IP restrictions".

As far as I know, there are no IP restrictions in the sandbox app.

Second, in the curl command which looked a lot like yours I left out the security token, so the password field was just the password.

Make sure IP restrictions are disabled as well and make sure that Permitted Users is set to "All users may self-authorize."

Please refer to the below posts for a similar discussion which has different solutions for such error see if that helps you.


Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

madhav sharma 1madhav sharma 1
Amazing Gift Ideas for a Newborn Baby

When it comes to celebrating the arrival of a newborn, there are a host of options that can often lead to a lot of confusion. From a gift box of baby essentials to adorable stuffed animals, you can choose from a variety of gifts for the little one. However, there is something incredibly special about personalized gifts.

Custom gift ideas
These personalized keepsakes not only show that you have put a lot of effort into creating them, but they are also a gift that remains special beyond time. So if you don't know what to give the newest member of the family, scroll down for a list of the best baby shower gift (https://showersandsprinkles.co.uk/" style="color:#0563c1; text-decoration:underline) ideas.

Personalized clothing
If you are looking for the right combination of utility with a touch of cuteness, we suggest going for custom baby clothes. From rompers that have the baby's name engraved on them to personalized bathrobes, there is no shortage of options when it comes to personalized clothing keepsakes for the little ones.

​The day you were born
What can be more special for children than having the memories of the day they were born, preserved in a pristine state? You can choose from keepsake scrolls containing data from the day of birth to a beautiful book illustrating the baby's journey woth baby boy gift (https://showersandsprinkles.co.uk/" style="color:#0563c1; text-decoration:underline). It can also include personal information such as the baby's time of birth and weight, as well as the zodiac sign and birthstone. These memories will take you on a journey through the day the little one was born.

Personalized soft toys
There is not a soul out there who is not incredibly attached to his first childhood toy. So, if you are struggling to choose a truly special yet foolproof little baby gift (https://showersandsprinkles.co.uk/" style="color:#0563c1; text-decoration:underline), go for personalized plush toys. Not only are they available in a variety of fun options, but you can embroider the child's name as well.

Customized treasure chest
Imagine having a wooden box filled with all of your baby's memories from her first item of clothing, the first "work of art" to the tiny anklet. As baby grows, she can keep adding more memories to this rustic looking chest. A box of memories indeed!

Birth announcement pillow
If you are looking for a simple but incredibly thoughtful new baby gift (https://showersandsprinkles.co.uk/" style="color:#0563c1; text-decoration:underline), you can go for a birth announcement pillow, which contains all the important information related to the child. From the date of birth, the baby's weight and height to the parents' name, it's a perfectly nostalgic keepsake.

Akshay Dhiman 63Akshay Dhiman 63
Hi Vladimir,

I think you just have to apply the "POST" method in the postman and change the password with "(Password+SecurityToken)".
Security Token is present in my setting >>> Reset my security token.
It will come in your email and apply it.  

Please follow the link below for more details:-

Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.