0

I have trial Enterprise account and I can successfully obtain a token with the below curl.

curl -v https://eu31.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=xxxxxxxxxxxxxxxxxxxxxxx" -d "client_secret=xxxxxxxxxxxxxxxxxxxxxxx" -d "username=nipun@force.com" -d "password=xxxxxxxxx" -k

Since I can't use SCIM APIs with an Enterprise trial, created another developer trial account and configured the exact same as previous. But now, the exact same request template doesn't return an error nor a token. Instead, it sends a redirect as below.

curl -v https://ap17.lightning.force.com/services/oauth2/token -d "grant_type=password" -d "client_id=XXXXXXXXXXXXXXXXXX" -d "client_secret=XXXXXXXXXXXXXXXXXX" -d "username=nipundev@abc.com" -d "password=XXXXXXXXXXXXXXXXXX" -k

Response (No response payload. Just a redirect.)

< HTTP/1.1 302 Found
< Location: https://ap17.salesforce.com/services/oauth2/token

Between the two requests, only the host name(copied from the browser URL) and the credentials are different.And they are correct.

Can anyone think of a reason for this?

Thanks in advance.


0

Sorted.

For some reason, SF developer accounts can't use the browser URL hostname for token call. You have to change the hostname as below.

https://login.salesforce.com/services/oauth2/token

Hope this will help someone.

Cheers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.