+ Start a Discussion
Mani PenumarthiMani Penumarthi 

How to get consumer Key and Secret Key of ConnectedApp dynamically in apex class?

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

Hi Manikumar

 

If you need to get consumer key and consumer secret then go to App Setup-> Develop ->Remote Access. Here you can create your new remote access ,  you will also get the consumer Key and consumer secret.

 

Check this following link:http://feedback.uservoice.com/knowledgebase/articles/235661-get-your-key-and-secret-from-salesforce

 

Use remote access to specify remote access applications, that is, applications external to salesforce.com that use the OAuth protocol to verify both the salesforce.com user and the external application. OAuth is an open protocol that allows secure authentication.

Mani PenumarthiMani Penumarthi
Thanks Ramesh.

What I actually need, is to pass the values of the consumerKey and Secret
Key in the url used in the class. So, how do we retrive those values
dynamically? I have multiple connected App's based on the cretria I need to
select the RemoteAccess.

Thanks & Regards,
Mani kumar P
manish1.394836910417755E12manish1.394836910417755E12
Mani - did you figure out how to do this? I am looking to solve a similar problem - trying to read key & secret into a Apex class.
Mani PenumarthiMani Penumarthi

As  per my research, we can't get the them dynamically. So I have written a VF page to enter the Key and secret values and validate them accordingly

Please correct me if I was wrong and share me if you could find any better solution.

Thanks,
Mani