To search public objects, we don't need an access token. Can we use DefaultFacebookClient?

18 views
Skip to first unread message

Yoav Shapira

unread,
May 29, 2010, 8:46:07 PM5/29/10
to RestFB
Most Graph API methods require the access token, which makes sense.
But just searching public objects doesn't. You can browse to
https://graph.facebook.com/search?q=watermelon&type=post for example
without an access token, without logging in, and it works.

I'd love to use RestFB for public searches. But DefaultFacebookClient
throws an exception if the access token passed to it is null or
empty. Before I hack something together, I wanted to ask if this is
simply a small oversight? Or am I doing something wrong?

Thanks for putting together a great library, Mark et al!

revetkn

unread,
May 29, 2010, 11:17:10 PM5/29/10
to RestFB
Yoav, thanks for using RestFB and for adding this to the issue
tracker. Unrelated, I want to say that I really appreciate your work
on Tomcat, which powers just about all of my Java web projects.

Lack of a default constructor in DefaultFacebookClient to allow for
access_token-less API access is an oversight on my part...I've never
needed to use the API without a token in my own projects, so I lost
sight of the fact that there are some people out there who do :)

I'll definitely correct this in 1.6. As you mentioned in the bug
report, it is unfortunately an awkward (but still doable) process to
subclass DefaultFacebookClient as a workaround.

Thanks
Mark

On May 29, 8:46 pm, Yoav Shapira <yo...@yoavshapira.com> wrote:
> Most Graph API methods require the access token, which makes sense.
> But just searching public objects doesn't.  You can browse tohttps://graph.facebook.com/search?q=watermelon&type=postfor example

Yoav Shapira

unread,
May 30, 2010, 6:41:53 PM5/30/10
to RestFB
Thanks, Mark!

On May 29, 11:17 pm, revetkn <mark.a.al...@gmail.com> wrote:
> Yoav, thanks for using RestFB and for adding this to the issue
> tracker.  Unrelated, I want to say that I really appreciate your work
> on Tomcat, which powers just about all of my Java web projects.

Glad you like it ;)

Yoav
Reply all
Reply to author
Forward
0 new messages