Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


suggestion for fixing issue: jugend/fgraph/issues/10 #11

wants to merge 1 commit into from

3 participants


fixes parsing error of access_token response when calling FGraph::oauth_access_token. issue: #10

@jugend jugend closed this

Is there a reason why this was never merged into the gem? I ran into the same issue yesterday, and this fix did the trick.


I never managed to create a proper test case for the bug-scenario, which of course was requested. The problem never seemed to appear at jugend.


Gotcha. I only ran into this problem after upgrading from REE 1.8.7 on Rails 3.0.10 to Ruby 1.9.3 on Rails 3.2.3. It may be environment-related. I'll try to look into writing a test for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 2, 2011
  1. fixes parsing error of access_token response when calling FGraph::oau…

    Dennis Wilson authored
    …th_access_token. issue: jugend/fgraph#10
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/fgraph.rb
12 lib/fgraph.rb
@@ -208,13 +208,21 @@ def oauth_access_token(client_id, client_secret, options={})
:client_id => client_id,
:client_secret => client_secret
}.merge(options || {}))
+ # facebook will responde with an url query formated string json
+ # so ensure to avoid :xml or :json parse mode
+ global_format = format
+ format :html
response = self.perform_get(url)
response_hash = {}
response.split('&').each do |value|
value_pair = value.split('=')
response_hash[value_pair[0]] = value_pair[1]
+ # restore global parser setting
+ format global_format
@@ -397,4 +405,4 @@ def get_id(id)
Something went wrong with that request. Please try again.