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

Is there a way to force clients of REST service to use their sessionId to access a REST service ? I can currently access this URL without any sessionId

I did add the Rest service class RESTClass... to the Public Access Settings of the tools Sites -> Apex Class Access.

Apex class methods that are exposed through the Apex REST API don't enforce object permissions and field-level security by default. We recommend that you make use of the appropriate object or field describe result methods to check the current user’s access level on the objects and fields that the Apex REST API method is accessing. See Schema.DescribeSObjectResult and Schema.DescribeFieldResult. - Exposing Data with Apex REST Web Service Methods

Schema.DescribeFieldResult F = Employee_c.Termination_Date__c.getDescribe();

F.isAccessible() returns true if user is allowed to see this field

Boy-if we have to do this for all fields even if we use a utility, that is a pain.


share|improve this question
If you want to force authenticated access, don't add it to the public site. – superfell Nov 5 '12 at 15:46
@superfell Also, will proxying access via a Remote App help ?… – techtrekker Nov 5 '12 at 16:12

The issue is that you would like to authenticate users before allowing access to the web service, but you are exposing the web service with public access. You will need to reduce the security to only internal users.

share|improve this answer

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.