I am using DFF for the FB connect features. All was working great as expected. I have only 1 app that is primary app.
I had to change the Facebook's App's name in Facebook and things broke apart.
DFF asked me to Edit the primary App to resync. When I clicked on Edit, there was White Screen giving ugly errors thrown up from Facebook SDK (I believe).
Sicne there is no other way to delete app without accessing EDIT,
I accessed the data tables and deleted the entry for the primary app in FB_app.
Now DFF has no App configured. But, when I try to create new App, I get the following:
Facebook API exception Invalid OAuth 2.0 Access Token.
#0 /home/live905/domains/live905base.com/public_html/sites/all/libraries/facebook-php-sdk/src/facebook.php(490): Facebook->_restserver(Array)
#1 /home/live905/domains/live905base.com/public_html/sites/all/modules/contrib/fb/fb.module(548): Facebook->api(Array)
#2 /home/live905/domains/live905base.com/public_html/sites/all/modules/contrib/fb/contrib/fb_permission.module(186): fb_fql_query(Object(Facebook), 'SELECT permissi...')
#3 [internal function]: fb_permission_form_alter(Array, Array, 'fb_app_edit_for...')
#4 /home/live905/domains/live905base.com/public_html/includes/common.inc(2892): call_user_func_array('fb_permission_f...', Array)
#5 /home/live905/domains/live905base.com/public_html/includes/form.inc(552): drupal_alter('form', Array, 'fb_app_edit_for...')
#6 /home/live905/domains/live905base.com/public_html/includes/form.inc(107): drupal_prepare_form('fb_app_edit_for...', Array, Array)
#7 [internal function]: drupal_get_form('fb_app_edit_for...')
#8 /home/live905/domains/live905base.com/public_html/includes/menu.inc(348): call_user_func_array('drupal_get_form', Array)
#9 /home/live905/domains/live905base.com/public_html/index.php(18): menu_execute_active_handler()
#10 {main}
$_REQUEST:
Array
(
[q] => admin/build/fb/fb_app_create
[has_js] => 1
[SESS3b8a2769af07ca197dcafb39f10e5b8e] => qi5smsedfabsj2h4qp8thmust3
[__utmb] => 227624965.1.10.1296411428
[__utmc] => 227624965
[__utma] => 227624965.1653004657.1296249136.1296407915.1296411428.9
[SESS1eb3185a7b73d89ab2eb98621adc644b] => m3obg67hs0krop2cqu769busr4
[__utmz] => 227624965.1296249136.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
)
REQUEST_URI:
/admin/build/fb/fb_app_create
It seems like DFF has stored some Oauth token in cache and using old token. Is there a way to clear all the cache variables and session variables of DFF?
I upgraded from DFF 3.0 rc7 to DF 3.0 dev of today. But still the problem persists.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | fb_permission_token.diff | 955 bytes | Dave Cohen |
| #9 | fb_permission_try_catch.diff | 4.84 KB | Dave Cohen |
Comments
Comment #1
rkarajgi commentedI disabled all fb modules and then uninstalled them. This removed all the tables and the data. Then enabled the modules again.
It is working properly now.
It will be great if there is a switch to just clear the stored session data of primary app - because uninstalling the module on a running live site may not be an option (all FB users will get wiped out).
Thanks
Comment #2
rezvani63 commentedI think this problem refers to fb_permission.module. from your code above I see this line:
I don't know this is module problem or Facebook problem. Facebook may have changed something in their API or ...!!!
I have the same problem, check it out here: http://drupal.org/node/1045074
Comment #3
Dave Cohen commentedJust checked in a fix to the D6 branch.
Comment #4
Dave Cohen commentedFix needs to be ported to D7 branch.
Comment #5
rezvani63 commented@Dave what about D6? It's still rc7 dated Jan-07. Is it safe to use development version for production site?
Comment #6
triskele commentedDave, can you post a copy of the patch? While the D7 port is pending I'd like to try and solve this problem as soon as I can.
Thanks,
- Angelina
Comment #7
ball.in.th commentedI just ran into "Invalid OAuth 2.0 Access Token" error on Add App page (/admin/build/fb/fb_app_create) on a fresh install of 6.x-3.0-rc7. Upgrading to 6.x-3.x-dev fixed the problem.
Comment #8
oddencreative commentedI am getting this on the dev and rc7:
Facebook API exception Invalid OAuth 2.0 Access Token.
#0 /mnt/monkeyco.de/sites/all/libraries/facebook-php-sdk/src/facebook.php(490): Facebook->_restserver(Array)
#1 /mnt/monkeyco.de/sites/all/modules/fb/fb.module(546): Facebook->api(Array)
#2 /mnt/monkeyco.de/sites/all/modules/fb/contrib/fb_permission.module(186): fb_fql_query(Object(Facebook), 'SELECT permissi...')
#3 [internal function]: fb_permission_form_alter(Array, Array, 'fb_app_edit_for...')
#4 /mnt/monkeyco.de/includes/common.inc(2892): call_user_func_array('fb_permission_f...', Array)
#5 /mnt/monkeyco.de/includes/form.inc(552): drupal_alter('form', Array, 'fb_app_edit_for...')
#6 /mnt/monkeyco.de/includes/form.inc(107): drupal_prepare_form('fb_app_edit_for...', Array, Array)
#7 [internal function]: drupal_get_form('fb_app_edit_for...')
#8 /mnt/monkeyco.de/includes/menu.inc(348): call_user_func_array('drupal_get_form', Array)
#9 /mnt/monkeyco.de/index.php(18): menu_execute_active_handler()
#10 {main}
$_REQUEST:
Array
(
[q] => admin/build/fb/fb_app_create
[SESSff940d8dedd417ac33575a705a7362f0] => kmo6m1cof82vi4actlmr1bmei4
[__utma] => 59667761.287664147.1296104108.1296630782.1296632719.17
[__utmz] => 59667761.1296104108.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
[__utmc] => 59667761
[has_js] => 1
[__utmb] => 59667761.1.10.1296632719
)
REQUEST_URI:
/admin/build/fb/fb_app_create
Comment #9
Dave Cohen commentedHere's the patch, just checked into 7.x-3.x branch. You won't need to apply the patch once d.o builds a new release.
Comment #10
drupalsam commentedHI Dave,
Applied the patch, once in enable extended Permission I get the same.
"Failed to get extended permissions. Invalid OAuth 2.0 Access Token" this time its show in a warning message and don't get the fields below the Facebook Extended Permission
Comment #11
Dave Cohen commentedYou should get the extended perms when you edit the settings, after you've added the apikey and secret. I don't know how to make it any easier.
Comment #12
ball.in.th commentedI am unable to get extended perms either. I've filled in App ID, API key, secret already. I got "Failed to get extended permissions. Invalid OAuth 2.0 Access Token" on the app edit page on 6.x-3.x-dev.
Comment #13
Dave Cohen commentedHere's a patch for that.
Comment #14
ball.in.th commentedWith patch in #13, extended perms now shows up on the app edit page and message "Failed to get extended permissions. Invalid OAuth 2.0 Access Token" is gone. Thanks a lot.
Comment #15
joshuabud commentedGreat work yet again Dave! Thanks for all your hard work.
Comment #16
nienaber commentedThe patch in #13 is this for 6.x-3.0-rc7?
It did not work for me. I keep getting:
API Error Code: 100
API Error Description: Invalid parameter
Error Message: invalid permissions: !perms
I can also not edit any of the permissions.
They do not show up.
Comment #17
triskele commentedI'm still getting the OAuth issue even after the patch in #13. What information is most useful for me to give you?
Comment #18
clkeenan commentedI am receiving the same "Failed to get extended permissions. Invalid OAuth 2.0 Access Token" error. I have all my keys entered as well. I'd be happy to provide any details. What would be most useful? Running on Dev 3.x (downloaded yesterday night).
Comment #19
c4antonio commentedSubscribed
Comment #20
Adriano72 commentedSubscribed
Comment #21
YK85 commentedsubscribing
Comment #22
l33tdawg commentedThe patch in #13 works without a hitch in 7.x-3.x-dev
Comment #23
bcobin commentedI have the same error message in rc10. Here's the story so far:
(I am logged in as superadmin in FF and am using Safari to test as the client.)
I had originally been able to connect with FB while I had the OAuth 3.x branch installed (OAuth is required to post to Twitter) - I only later learned that the OAuth 3.x branch is not yet compatible with Twitter. I then had to install OAuth 2.02 to get Post to Twitter working correctly.
After that, I was unable to connect successfully to FB. I ended up uninstalling DFF, deleting the FB app, and creating a new one. I then logged in in via FB connect, and the FB app asked for permissions. (Hooray!) When I logged into Drupal, though, I was redirected to an Access Denied page.
Going to My Account, the FB account was linked (Hooray again!), but I get a "Failed to get Facebook user info for account 0123456789: Invalid OAuth 2.0 Access Token 190" message. Clicking on the full application name in My Account generates the error below.
I hope I'm posting this in the right place; it seems most applicable to the original topic, although it seems there was some diversion to the "extended apps" issue in the thread.
Could there be some old OAuth data on FB that's conflicting with the new app? Is there any way to "start fresh" here without deleting the user? I think I'm almost there - any guidance would be greatly appreciated!
And, of course, kudos to Dave for all the great work he's doing here. Thanks much!
Error message:
Comment #24
Dave Cohen commented@bcobin, would you mind submitting another issue for that? A fix for that will be in fb_permission.module, and not the same fix for this thread.
Comment #25
bcobin commentedWith pleasure, Dave. Issue has been reposted at http://drupal.org/node/1097966
Thanks much!