[SalesForce] Accessing chatter user profile picture from sites

I have to access a chatter photo in Sites VF page using partner portal.
I know that chatter photo cant be accessed by partner portal users. Is there any work around?

I saw this link which says that we can implement using oauth token.
http://blogs.developerforce.com/developer-relations/2011/03/accessing-chatter-user-pics.html

Here is my photo url :-
https://c.cs11.content.force.com/profilephoto/729G00000008q3L/F

How do I obtain the oauth token? I just created a remote access with call back url as :- https://app.example.com/oauth/callback
and these two keys got generated automatically :-

Consumer Key :-

[deleted]

Consumer Secret :-

[deleted]

and here is my sites url (integrated with partner portal):-
http://xy.xyz.cs11.force.com/MySite/

Can You please tell me what I need to append in my url and which url (c.cs11.content or my site url?) and what token should i append to see my photo in my site?

Best Answer

Finally I found the solution. Instead of using Oauth, I did the same in a different way.

  1. Created one custom object with a lookup to user.
  2. Created a field to save the 'FullPhotoURL' of that user
  3. Got the image as blob and saved as an attachment to this custom object.

From my sites page, I queried this Custom object and showed the image from the attachment

Related Topic