Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We created an appexchange application that runs on Heroku. This application can run without the user loging-in each time. For this we use the Remote access app with consumer key and consumer secret. Now the issue is that an administrator need to setup this remote access application and het needs to paste the consumer key and secret in our application to properly work.

I would like to eliminate that step so our application can query through apex for the consumer key and secret, is this Possible?

I want in fact the same approach like Chatter desktop uses, but i can't find any documentation about this topic.

Thanks for your help!

share|improve this question
Why does an admin need to handle the remote access credentials? A remote access app defined in one org can be used by users in any number of other orgs without creating any consumer keys/secrets. – metadaddy Sep 18 '12 at 13:38
up vote 3 down vote accepted

No - it's not possible to retrieve a remote access app's consumer key/secret via Apex.

The approach Chatter Desktop uses is the OAuth 2.0 'user agent' flow - the Chatter Desktop carries a consumer key, but no secret, since an attacker could just read it out of the app's binary.

share|improve this answer
Thx for the answer metadaddy we will investigate this further out. the document is quite clear thx – Sven Delporte Sep 18 '12 at 19:10
User agent flow is indeed the solution for our problem. We use the client id(consumer key) in our code and we don't use the secret – Sven Delporte Sep 24 '12 at 13:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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