Skip to content

Application Access Tokens - OAuthException #62

Closed
bhellman1 opened this Issue May 3, 2011 · 2 comments

2 participants

@bhellman1

This gem looks amazing, thank you!

I'm working to create an Application Access Token as discussed here: https://github.com/arsduo/koala/wiki/OAuth

Here's what I have in my controller:

@oauth = Koala::Facebook::OAuth.new
@oauth_token = @oauth.get_app_access_token
@graph = Koala::Facebook::GraphAPI.new(@oauth_token)
@fb = @graph.search('larry@google.com', {:type => "user"})  

Problem is this errors with: OAuthException: An access token is required to request this resource

Suggestions? thanks

@cbaclig
cbaclig commented May 5, 2011

It seems like the search method requires an actual user access token, not just an application access token like you're using in your example. I tried the same query with a logged-in user's access token, and it worked fine. The first examples on https://github.com/arsduo/koala/wiki/OAuth describe different ways of getting a user's access token (via OAuth redirects, the Javascript SDK, etc.) which you should be able to use to make your queries.

In general, the app access token is only used for application-specific things, like getting your app's insight data, registering real-time updates, generating test user's, etc.

Let us know if that helps!

@bhellman1

Thanks cbaclig that helps.

@bhellman1 bhellman1 closed this May 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.