You need to sign in to do that
Don't have an account?
OAuth implementation in Salesforce
Hi,
I want to implment OAuth security in salesforce and for that I have created connected app and I am able to access data from third party application by using Bearer token (generated by using client id and client secret). but i have following doubts as,
1) When we create connected app then is it available/mandotary for all services to authorize oAuth connected app ??
2) Can we restrict oAuth for some/limited services like lead, case services only ?
please help me to solve it.
Thanks :)
I want to implment OAuth security in salesforce and for that I have created connected app and I am able to access data from third party application by using Bearer token (generated by using client id and client secret). but i have following doubts as,
1) When we create connected app then is it available/mandotary for all services to authorize oAuth connected app ??
2) Can we restrict oAuth for some/limited services like lead, case services only ?
please help me to solve it.
Thanks :)
1.) Yes,it is mandatory for all the services using the connceted app to authorize the connected app.
2.) Access is controlled by the oAuth scope which you will select while creating app.There are quite a few options available to select.Go through the below link to learn more about the options :-
https://help.salesforce.com/htviewhelpdoc?err=1&id=connected_app_create.htm&siteLang=en_US#oauth
If this helps,please mark it as best answer to help others :)
Thanks for your reply :)
I would like to know, How can I test oAuth with REST services ???
Before I use workbench, it gets authenticated as well as authorized.
I tried using soap ui tool, and I am able to access salesforce by using accessToken (client id, client secret, username, password and grant_type) but I would like to test the same service without oAuth and I want to check whether it allows me or not.
If I dont create connected App for oAuth and I want to access rest services then how can I access it ???
Thanks :)
Go through the below link to lear more about HTTP Request class :-
http://www.salesforce.com/us/developer/docs/dbcom_apex250/Content/apex_classes_restful_http_httprequest.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http.htm
Hope this helps !!
Sorry to say but still I am confuse in understanding connected app working for oAuth.
For making my query simple,
1) How can I create Lead in salesforce through rest service using SOAP UI tool, if connected app is not created (Basic Authentication)??
Rest Service URI - https://ap1.salesforce.com/services/data/v29.0/sobjects/Lead
JSON POST Data - {
"LastName" : "lastNmae",
"Company" : "TCS"
}
2) I want to use oAuth only for rest service request uri as https://ap1.salesforce.com/services/data/v29.0/sobjects/Account and If any other rest request arrives then it should be allowed with basic authentication. So please let me know how can i achieve this ???
Thanks alot for giving your valuable time to help me :)
1.) SOAP UI is a SOAP based tool for REST API you should be using REST based tool like Fiddler or Rest Client.
2.) for your 2nd question go through my answer at below post .
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AWWDIA4
Hope this helps !!
I tried the to send HTTP request with rest client but getting the same response.
Is it must to authorize with oAuth while using rest service ?
Thanks :)
1.) Authorize the request for the first time and get the authorization token.
2.) Once you have Authorization token use it in your subsequesnt request (Like,GET,PUT,PATCH.etc.)
Hope this helps !!
I want to invoke above rest service from rest client WITHOUT using oAuth.
when I hit that url the Lead metadata information shold be display as it appears in workbench.
Can you please tell me, then also it will two step process,
1) get the session id (if yes then how to get session id means URI to get session id)
2) use the session id to invoke service
Thanks :)