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
Jayamaruthyraman JaganathJayamaruthyraman Jaganath 

OAuth token & Trailhead Playground

Does anyone know if we can get an OAuth token against a trail playground instance? 

The following command always returns the {"error":"invalid_grant","error_description":"authentication failure"}* error.

curl -v https://TrailPlayground.my.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=xxxx" -d "client_secret=yyyyy" -d "username=user@email.com" -d "password=PW&Token" -H 'X-PrettyPrint:1'.

thanks

​​​​​​​Jay
Best Answer chosen by Jayamaruthyraman Jaganath
Jayamaruthyraman JaganathJayamaruthyraman Jaganath
My experience is curl can't be used against trailhead playground. 

All Answers

GovindarajGovindaraj
Hi Jaya,

I belive you should use (login.salesforce.com) like below,

curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=xxxx" -d "client_secret=yyyyy" -d "username=user@email.com" -d "password=PW&Token" -H 'X-PrettyPrint:1'

Please let us know if this helps.

Thanks,
Govindaraj.S
Jayamaruthyraman JaganathJayamaruthyraman Jaganath
Hi Govind, Thanks for the response. I was indeed going against a trailhead playground. It did not work. However, it works for the login.salesforce.com url. thanks Jay
GovindarajGovindaraj
Great Jay ! Can you please help this community by closing the solved cases.
Jayamaruthyraman JaganathJayamaruthyraman Jaganath
My experience is curl can't be used against trailhead playground. 
This was selected as the best answer