I'm getting the below error when I logged out of facebook but still logged in and do a refresh on my site.
Facebook API exception Invalid OAuth 2.0 Access Token.
#0 .../sites/all/modules/fb/facebook-platform/php/facebook.php(469): Facebook->_restserver(Array)
#1 .../sites/all/modules/fb/fb.module(296): Facebook->api(Array)
#2 .../sites/all/modules/my_modules/my_modules.module(117): fb_fql_query()
#3 .../includes/module.inc(462): my_modules_block(Object(Facebook), 'SELECT uid FROM...')
#4 .../modules/block/block.module(499): module_invoke()
#5 .../includes/theme.inc(1626): block_list('view', 'fb_users_list_b...')
#6 .../includes/theme.inc(656): theme_blocks(my_modules_...', Array)
#7 .../includes/theme.inc(1820): theme()
#8 .../includes/theme.inc(697): template_preprocess_page(my_modules', 'block', 'view', 'fb_users_list_b...')
#9 .../sites/all/modules/panels/plugins/tasks/panel_page.inc(202): theme()
#10 .../sites/all/modules/ctools/delegator/plugins/tasks/page.inc(335): panels_panel_page_execute('fb_block')
#11 .../includes/menu.inc(348): delegator_page_execute('fb_block')
#12 .../index.php(18): menu_execute_active_handler()
#13 {main}
$_REQUEST:
Array
(
.... truncated ...
)
REQUEST_URI:
/
Please help. Am I supposed to get this error? Or is there an error in my configuration? How can I show the homepage instead of the white screen with these errors? Although it gets away but it takes time before the home page loads again. Thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | error-drupal.png | 36.17 KB | forexpivots |
| #25 | fb_permission_token.diff | 955 bytes | Dave Cohen |
Comments
Comment #1
Dave Cohen commentedYou say you are logged out of facebook, so I suspect this is the correct behavior, rather than an error. Facebook is telling you that you can't make the FQL query when the user has not authorized the app (which is the case when not logged into facebook).
If you really need to make such a query when a user is not logged in, you'll need the user to approve the off-line access extended permission.
Comment #2
krem commentedSince today I am having the same error... Afterward I tried to upgrade fb module to latest and facebook sdk as well but still the same error. Furthermore, I tried to compltely uninstall everything and now I can't create a new facebook app in fb module ! Am I the only one to get this problem ? If it's the case, I must be doing something wrong...
Comment #3
creatile commentedHello, I have the same problem. Can't create new facebook application with FB 3x and latest sdk.
Should i configure specific parameters to make it work properly on my facebook application account ?
Or
I may not use the latest sdk release ?
Comment #4
strae commentedSame problem here, i updated the module today with the version of yesterday (28 September 2010).
After the update, the cron report this error:
I checked twice the app apikey, secret and id, i uninstalled the module, deleted the facebook app, then reinstalled the module, recreate a new facebook app, but when i try to add it in `admin/build/fb/fb_app_create` i allways got these errors.
The strange things is that i've tryed to use the 'old' 6.x-3.x-dev version that used to work till yesterday, but the problem persist... so i have the doubt that the issue is not related to the module (used to work till yesterday!) but with facebook auth... could be that facebook has changed they'rs auth method, or somethings like?
Comment #5
chrisjlock commentedFacebook Devel shows:
Array
(
[fb_devel] => Array
(
[FB_OP_POST_INIT] => 51
)
[dblog_overview_filter] => Array
(
)
[messages] => Array
(
[error] => Array
(
[0] => Failed to get application properties (Ap Label) from Facebook: Invalid OAuth 2.0 Access Token 190
[1] => Unable to get application properties. Confirm both apikey and secret.
)
)
)
Comment #6
strae commentedPlease dont edit the issue title when submitting new comments.
Comment #7
strae commentedMaybe i got it.
I analyzed the URI generated in fb.module file at fb_call_method() function, i think the problem is here;
This function encode some characters (commas for example), so the URI it spit out is (for example):
I copy'n'pasted this in my browser, and i got the OAuth error.
So, i replaced the url_encoded chars with the originals:
Then, used this directly in the browser: it works.
Try out by your own, replace
with
into your fb.module file inside the function fb_call_method (about line 301), then it should work.
to all copy'n'paste guys: please note that this is not a patch, and the url i build do not take care about input satinization, this 'solve' this issue but could probably open many others; DO NOT USE MY EXAMPLE IN PRODUCTION
Edit: After several attempts, i got that the problem (im my case, check your own) is the %7 char in the access_token var that get encoded in %257
Comment #8
strae commentedComment #9
Dave Cohen commentedThanks for the detail. To be honest, I'm puzzled why a problem like this would just start happening. I'd be surprised if facebook made a change that caused this (but not too surprised).
Comment #10
lmakarovCan report the same issue. Started today. No changes or updates were done.
Sounds like this is some change or issue on FB side...?
Comment #11
nrosell commentedsubscribing.
#7 solved my problem.
Thanks a lot.
Comment #12
Dave Cohen commentedYeah, I see it too. Definitely a change on the facebook side.
I appreciate the details from Strae. Will try to get something committed soon.
Comment #13
Dave Cohen commentedhere's what I'm testing as a fix. Haven't noticed bad side effects (yet).
Comment #14
Dave Cohen commentedI no longer think the patch above is necessary. Facebook seems to have fixed the problem.
Comment #15
strae commentedI confirm, today it's ok.
Comment #17
rezvani63 commented@Dave Cohen @Strae I'm facing "Invalid OAuth 2.0 Access Token." message. This is when I activate fb_permissions.module. Do you think Facebook again changed it's API? What's th solution?
Comment #18
idot commentedsame problem when trying to add an app I get "Facebook API exception Invalid OAuth 2.0 Access Token" and
#0 .../sites/all/libraries/facebook-php-sdk/src/facebook.php(490): Facebook->_restserver(Array)
#1 .../sites/all/modules/fb/fb.module(546): Facebook->api(Array)
#2 .../sites/all/modules/fb/contrib/fb_permission.module(186): fb_fql_query()
#3 .../includes/common.inc(2892): fb_permission_form_alter(Object(Facebook), 'SELECT permissi...')
#4 .../includes/form.inc(552): drupal_alter()
#5 .../includes/form.inc(107): drupal_prepare_form(Array, Array, 'fb_app_edit_for...')
#6 .../includes/menu.inc(348): drupal_get_form('fb_permission_f...', Array)
#7 .../index.php(18): menu_execute_active_handler()
#8 {main}
$_REQUEST:
Array
(
[q] => admin/build/fb/fb_app_create
[__utma] => 141730922.2125940019.1286147812.1286147812.1292832903.2
[__utmz] => 141730922.1286147812.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
[__utma_a2a] => 4564551935.1324564110.1293007184.1295871261.1295871674.22
[SESSe5eaadeafc4809b7ac359989a013f335] => e4ceb9b9f335ba3f018ccc0d229508d1
[has_js] => 1
)
REQUEST_URI:
/?q=admin/build/fb/fb_app_create
what cause that error?
Comment #19
cyrilar commentedI had the same error, and to resolve it, i had to uncomment the line 544 of fb.module in sites/all/modules/fb/fb.module.
You'll have to comment the two next lines too, like that
function fb_fql_query($fb, $query, $params = array()) {
$params['query'] = $query;
$result = fb_call_method($fb, 'fql.query', $params);
/*$params['method'] = 'fql.query';
$result = $fb->api($params);*/
return $result;
}
Sorry if i got a bad english, i'm french ;)
Comment #20
Dave Cohen commentedI checked in a fix for that. Updating the latest .dev release should help you.
I don't generally look in closed issues for new comments. You should start a new issue when reporting a new problem.
Comment #21
adityagada commentedThanks Cyrilar.
But the function was on line 570.
Comment #22
ranx commentedRC7 worked just fine until i enabled the extended permissions module. Now I got the same error as the original poster.
Latest dev version replaced the white screen and long OAuth Access Token error with: "Failed to get extended permissions. Invalid OAuth 2.0 Access Token"
So something still seems to be broken.
Also tried the fix suggested in #19 and got he following error : "warning: fread() [function.fread]: SSL: fatal protocol error in /home/la02/16140509/includes/common.inc on line 552."
Comment #23
Dave Cohen commentedWith the current .dev build, you should be able to save the application, then return to the edit form and select extended permission.
Facebook doesn't allow a query of the extended permission list until the apikey and secret are known.
Comment #24
rrrob commentedI'm using the latest dev build, and I get the same error as poster #22: "Failed to get extended permissions. Invalid OAuth 2.0 Access Token"
I am able to edit the apps settings, but the "Facebook extended permissions" fieldset still says 'Failed to get extended permissions from facebook. Submit this form, then click "edit" to see extended permission options.' even after I save the form and then edit the app again.
Comment #25
Dave Cohen commentedThanks for pointing that out.
Comment #26
Dave Cohen commentedSorry, posted to wrong issue. fb_permission issue is #1045484: Facebook API exception on create app page
Comment #27
forexpivots commentedI have the same problem here.
Also, it's not retrieving the picture in the Forum Posts.
See screenshot.
Comment #28
forexpivots commentedHi guys,
Just following up on this issue.
It seems that this is getting worse.
Now I don't have the User Picture and the Username has vanished too. The content on the post remains alright, but username and picture is gone.
When I go to User Admin, I can see the user there, the e-mail, etc...
Can someone give me a hand...I'd appreciate.
Thanks a bunch, guys!
Comment #29
Dave Cohen commentedPlease start a new issue. This is not the same problem as originally reported.
Comment #30
msti#19 solved the error for me
Failed to query facebook user info: Invalid OAuth 2.0 Access Token 190. (logged into facebook as )
using rc8