You need to sign in to do that
Don't have an account?
trick1
Web Services
Hi Friends,
Consumer Key
Consumer Secret
I need to know,for example, when I register some website in the remote setting in salesforce in order to make callouts.
Consumer Key means what Does it belongs to salesforce or the website which was registered in salesforce.
Is it same about consumer secret.
Can somebody please explain with an example ?.
Thanks
Trick
Hi,
Consumer Key = A value used by the Consumer to identify itself to the Service Provider.
Consumer secret = A secret used by the Consumer to establish ownership of the Consumer Key.
They can be used in providing secure access to one org to other app. They are used widely in Authentication process. Here is a small code to show how they can be used in OAuth.
public OAuth2_0Test()
{
res_type='code';
consmer_key='3MVG9Y6d_Btp4xp45E9eBK0VDYe8XZSHIcWX0VDl6EFunivy0z0FJAGchDCvYGIFnO.MoWKS_oWOtT';
redrct_uri='https://c.ap1.visual.force.com/apex/Complete_OAuth2';
url = 'https://login.salesforce.com/services/oauth2/authorize?immediate=false&response_type=code&client_id='+consmer_key+'&redirect_uri='+redrct_uri+'&scope=full';
HttpRequest req = new HttpRequest();
req.setEndpoint(url);
req.setMethod('GET');
Http http = new Http();
HTTPResponse res = http.send(req);
response=res.getBody() ;
System.debug('________________response_______________________________'+res.getBody());
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Hi Navatar_dbSup.
Thanks a lot for your reply .
My scenario is like this.I have salesforce customer portal and on that portal I have link on which when we click it takes you to some other web site.
In this scenario,Who is going to be the service provider and who is going to be the consumer.Can u please explain that?
In my opinion ,customer portal seems to be the consumer and that site which will be called through some other rest based web service will be the provider.Please correct me if I am wrong.
if I am correct ,do I need to register that website in remote settings and then generate client id and consumer id and then Who is going to use those ID's and How ?
Please ignore my ignorance I know i am asking some very basic questions.
What is the difference between URL and redirect_uri. ?
If u know how I can do this some portal to the web site, please help me.I mean some basic steps will give me a start.
I wil really appreciate your quick responsse.Any sort of help here will be highly appreciated?
Thanks,
Trick