3

I am working on creating a Force.com site and I have a VF page which displays fields from a custom object record and also displays its Chatter feed. I achieved displaying the Chatter feed using the Chatter connect API.

Now this page shows up fine when I access it directly. Now I want it to be accessed via the Force.com site and without authorization(Site Guest user profile). When I tried doing this I initially got an "Authorization required" error. I knew that this happens when there is usually some other error behind the scenes.

So I created another simple VF to make a call to this VF page and I displayed the content from the response and sure enough this was the actual error.

The Connect API is not enabled for this user type.

I tried searching for it and found this thread in the force.com boards. http://boards.developerforce.com/t5/Chatter-and-Chatter-API/The-Chatter-Connect-API-is-not-enabled-for-this-organization-or/td-p/326469

Per this, The API should be accessible if the profile has "API Enabled" in the system permissions. And my Site guest profile has this turned on(It was off initially and I turned it on but I still am getting the error).

Is there anything else that I can do to enable my Site guest user to be able to view my VF page and gain access to this Connect API? Thanks.

3

I suspect the problem is not that the API is enabled, rather that the user license type does not support Chatter.

It's all well and good that you've turned on API enabled. The clue to your problem is in an earlier post in the thread you reference.

"As with any other API, once the user approves the API client, the API client can do anything that user can, including reading and writing data."

To reverse the logic a bit: the API client can't do anything that the user is not allowed to do

Chatter requires a user with a Chatter license, and the site Guest user license does not fit that bill. You must have a user with (at the very least) Chatter Free permissions. Although I've not read up on communities and how those portal licenses play into this discussion.

As of the release of Summer 13 (API version 28) the way to solve this is to implement Chatter communities. This is the solution going forward to expose Chatter capabilities into publicly available communities.

  • 1
    Thanks for the information. Its rather sad that the guest user cannot access this information because we wanted this site to be accessed by anyone in our local network without logging in. Also the force.com sites page mentions this.."With Force.com sites, you no longer have to do any of those things. You can publicly expose any information stored in your organization through a branded URL of your choice." Do you know of any workarounds? Is there a way to say, associate the site with another user with a chatter/chatter plus license without requiring a login? – Richard N Jul 8 '13 at 15:33
  • Also found this where it confirms that Site users do not have API access. help.salesforce.com/apex/… – Richard N Jul 8 '13 at 16:38
  • 2
    Seems easy enough to store the name and password of a Chatter Free user in a custom setting, use that information to sign-in, get a session ID and then make the API call. You lose the coolness of the Connect for Chatter feature, but it'll get the job done. – pchittum Jul 8 '13 at 20:51
  • That is interesting. Can you elaborate further? How can we perform a general salesforce login in an APEX controller. This will also mean I will need to make a REST API call instead of using the Connect namespace right? – Richard N Jul 8 '13 at 21:53
  • 1
    I've updated my answer to reflect the discussion of Chatter communities. Thanks for accepting. – pchittum Jul 26 '13 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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