OAuth Dance — “client identifier invalid” with Salesforce.com

December 21st, 2012

So over at CloudSpokes we use OAuth for everyone that logs into our Database.com (Salesforce) org. It’s been working fine for over a year but the last couple of days the OAuth dance have been failing randomly (5% of the time?) for one our our rails apps with the following error:

client identifier invalid

What made it so strange was that it had been working for quite awhile without any code changes for thousands of logins per day. I Googled around for the answer (couldn’t find much at all) and even posted to the Developerforce security board with no luck (or replies). The code is pretty much basic boilerplate Databasedotcom:

I raised the question to Eric Holmes, one of the other committers for the databasedotcom gem, and he had the bright idea to specify the actual pod in the host instead of the generic “login.salesforce.com”. After I switched the host to our pod, “na7.salesforce.com”, I stopped receiving the oauth errors. I thought I might blog about this in case some else runs across the same issue.

VN:F [1.9.22_1171]
Rating: 6.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
OAuth Dance -- "client identifier invalid" with Salesforce.com, 6.0 out of 10 based on 1 rating

Categories: Ruby, Salesforce

Leave a comment

Comments Feed1 Comment

  1. Atul Kumthekar

    I am trying my luck with Heroku Force integration using the template. I am getting the same client Id error. (error=invalid_client_id) I set only two env variables per the documentation: http://wiki.developerforce.com/page/Integrating_Java_Spring_Apps_on_Heroku_with_Force.com_REST_APIs
    which asks to set: OAUTH_CLIENT_KEY and OAUTH_CLIENT_SECRET, but when app is run and i go to url and click contact link in browser, i get error for different variables (SFDC_OAUTH_CLIENT_ID, SFDC_OAUTH_CLIENT_SECRET). So i set those but now dont know what should be their values….

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a comment


http://blog.jeffdouglas.com / OAuth Dance — “client identifier invalid” with Salesforce.com