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
Steve Berley [Left Propeller]Steve Berley [Left Propeller] 

curl to sandbox but not prod

Using curl, we're able to connect to a sandbox and salesforce returns an access_token.

However, when we update curl to use the endpoint and credentials (client_id, client_secret, username, and password) for production, the system returns -- 

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

The curl stament is as you'd expect...
curl https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=ididididid" -d "client_secret=secretsecretsecretsecretsecretsecret" -d "username=usernameusername" -d "password=passwordtokenpasswordtoken"

The login accessing both environments is configured as an admin with api access.

The connected apps in the sandbox and prod are configured identically.

Stumped!

Thanks for your advice on this...

Steve 
Santosh Reddy MaddhuriSantosh Reddy Maddhuri

Hi Steve,

Try adding your Security Token to your Password and see if that works.

Regards,

Santosh.