facebook-node-sdk icon indicating copy to clipboard operation
facebook-node-sdk copied to clipboard

error: Invalid OAuth access token signature.

Open sebpiq opened this issue 11 years ago • 11 comments

Hi!

I am trying to get started; and I have this very simple code :

var Facebook = require('facebook-node-sdk')

var facebook = new Facebook({
    appID: 'my app id',
    secret: 'my app secret'
})

facebook.api('/me', function(err, data) {
  console.log(err, data)
})

I don't know what's the problem, but I keep getting this error :

{ result: 
   { error: 
      { message: 'Invalid OAuth access token signature.',
        type: 'OAuthException',
        code: 190 } },
  code: 0,
  message: 'Invalid OAuth access token signature.' }

did I miss something very basic?

sebpiq avatar May 17 '13 08:05 sebpiq

I get the same error and I've tried resetting the secret key without any luck

leftieFriele avatar May 21 '13 10:05 leftieFriele

Don't forget to set your access token.

var facebook = new Facebook({
    appID: 'my app id',
    secret: 'my app secret'
}).setAccessToken('access token');

BaseInfinity avatar May 26 '13 03:05 BaseInfinity

@BaseInfinity how do you get this access token? In my app page I have only the id and the secret.

sebpiq avatar May 26 '13 07:05 sebpiq

Had this issue too. Did what @BaseInfinity said.

@sebpiq Go to https://developers.facebook.com/docs/facebook-login/access-tokens/

For an App access token

GET /oauth/access_token? client_id={app-id} &client_secret={app-secret} &grant_type=client_credentials

awm33 avatar May 27 '13 14:05 awm33

https://developers.facebook.com/docs/howtos/login/login-as-app/:

“Because it requires you to include your App Secret you should not attempt to make this call client-side as that would expose this secret to all your app users. It is important that your App Secret is never shared with anyone. For this reason, this call should be performed server-side”

And for the app access token, it’s the same – you should never use it client-side, because every user could spot it there and then start using it to perform actions on behalf of your app (or change many of your app’s settings).

If you have a server-side part to your application, you can simply “build” the app access token there yourself, concatenating app id and secret with a pipe symbol, app_id|app_secret.

Troush avatar May 27 '13 22:05 Troush

The issue is the param 'appID' should be 'appId': appID: 'my app id',

gilesgoodwin avatar Nov 14 '13 17:11 gilesgoodwin

Just ran into this too - it looks like the README example has the wrong capitalization

mjpizz avatar Nov 17 '13 03:11 mjpizz

OMG! Thanks for pointing out the capitalization issue!

I was grinding my teeth dreading having to jerry rig some kind of GET token request and wondered why this lib didn't just do it... this explanation makes a lot more sense :P

paulbrzeski avatar Apr 22 '14 14:04 paulbrzeski

I don't know me by AccessToken getCurrentAccessToken () method to get the token is a token of the APP or the user's token, through "https://graph.facebook.com/debug_token? Access_token = {My AppId} | {CMy AppSecret} & input_token = {AccessToken. GetCurrentAccessToken () access token} "the interface returned My token validation error of this information.

KouSyurei avatar Nov 22 '18 03:11 KouSyurei

I am facing this issue, can anyone help me with this please E/flutter (17544): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(login_in_progress, loginWithReadPermissions called while another Facebook login operation was in progress., null) E/flutter (17544): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter (17544): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33) E/flutter (17544): E/flutter (17544): #2 FacebookLogin.logInWithReadPermissions (package:flutter_facebook_login/flutter_facebook_login.dart:106:23)E/flutter (17544): E/flutter (17544): #3 _FBLoginState._logIn (package:fb_login/fbLogin.dart:18:34) E/flutter (17544): E/flutter (17544): #4 _FBLoginState.build. (package:fb_login/fbLogin.dart:94:19) E/flutter (17544): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14) E/flutter (17544): #6 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:711:32) E/flutter (17544): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) E/flutter (17544): #8 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11) E/flutter (17544): #9 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7) E/flutter (17544): #10 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9) E/flutter (17544): #11 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13) E/flutter (17544): #12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11) E/flutter (17544): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) E/flutter (17544): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) E/flutter (17544): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter (17544): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter (17544): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter (17544): #18 _rootRunUnary (dart:async/zone.dart:1136:13) E/flutter (17544): #19 _CustomZone.runUnary (dart:async/zone.dart:1029:19) E/flutter (17544): #20 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7) E/flutter (17544): #21 _invoke1 (dart:ui/hooks.dart:250:10) E/flutter (17544): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5) E/flutter (17544): D/SecWifiDisplayUtil(17544): Metadata value : none D/ViewRootImpl(17544): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{22b7774 I.E...... R.....I. 0,0-0,0} D/mali_winsys(17544): new_window_surface returns 0x3000, [1440x2560]-format:1 D/ViewRootImpl(17544): MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1 W/DisplayListCanvas(17544): DisplayListCanvas is started on unbinded RenderNode (without mOwningView) I/Timeline(17544): Timeline: Activity_idle id: android.os.BinderProxy@db25b6b time:12090929 I/Timeline(17544): Timeline: Activity_launch_request id:com.facebook.katana time:12091149 V/ActivityThread(17544): updateVisibility : ActivityRecord{51825e4 token=android.os.BinderProxy@8c7c57f {com.example.fb_login/com.example.fb_login.MainActivity}} show : true V/ActivityThread(17544): updateVisibility : ActivityRecord{845543f token=android.os.BinderProxy@db25b6b {com.example.fb_login/com.facebook.FacebookActivity}} show : true I/Timeline(17544): Timeline: Activity_idle id: android.os.BinderProxy@8c7c57f time:12091661 D/ViewRootImpl(17544): #3 mView = null I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false V/ActivityThread(17544): updateVisibility : ActivityRecord{51825e4 token=android.os.BinderProxy@8c7c57f {com.example.fb_login/com.example.fb_login.MainActivity}} show : true W/System.err(17544): remove failed: ENOENT (No such file or directory) : /data/user/0/com.example.fb_login/files/AppEventsLogger.persistedevents I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false

noor2096 avatar Sep 03 '19 09:09 noor2096

I am facing this issue, can anyone help me with this please E/flutter (17544): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(login_in_progress, loginWithReadPermissions called while another Facebook login operation was in progress., null) E/flutter (17544): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter (17544): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33) E/flutter (17544): E/flutter (17544): #2 FacebookLogin.logInWithReadPermissions (package:flutter_facebook_login/flutter_facebook_login.dart:106:23)E/flutter (17544): E/flutter (17544): #3 _FBLoginState._logIn (package:fb_login/fbLogin.dart:18:34) E/flutter (17544): E/flutter (17544): #4 _FBLoginState.build. (package:fb_login/fbLogin.dart:94:19) E/flutter (17544): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14) E/flutter (17544): #6 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:711:32) E/flutter (17544): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) E/flutter (17544): #8 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11) E/flutter (17544): #9 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7) E/flutter (17544): #10 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9) E/flutter (17544): #11 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13) E/flutter (17544): #12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11) E/flutter (17544): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) E/flutter (17544): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) E/flutter (17544): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter (17544): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter (17544): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter (17544): #18 _rootRunUnary (dart:async/zone.dart:1136:13) E/flutter (17544): #19 _CustomZone.runUnary (dart:async/zone.dart:1029:19) E/flutter (17544): #20 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7) E/flutter (17544): #21 _invoke1 (dart:ui/hooks.dart:250:10) E/flutter (17544): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5) E/flutter (17544): D/SecWifiDisplayUtil(17544): Metadata value : none D/ViewRootImpl(17544): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{22b7774 I.E...... R.....I. 0,0-0,0} D/mali_winsys(17544): new_window_surface returns 0x3000, [1440x2560]-format:1 D/ViewRootImpl(17544): MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1 W/DisplayListCanvas(17544): DisplayListCanvas is started on unbinded RenderNode (without mOwningView) I/Timeline(17544): Timeline: Activity_idle id: android.os.BinderProxy@db25b6b time:12090929 I/Timeline(17544): Timeline: Activity_launch_request id:com.facebook.katana time:12091149 V/ActivityThread(17544): updateVisibility : ActivityRecord{51825e4 token=android.os.BinderProxy@8c7c57f {com.example.fb_login/com.example.fb_login.MainActivity}} show : true V/ActivityThread(17544): updateVisibility : ActivityRecord{845543f token=android.os.BinderProxy@db25b6b {com.example.fb_login/com.facebook.FacebookActivity}} show : true I/Timeline(17544): Timeline: Activity_idle id: android.os.BinderProxy@8c7c57f time:12091661 D/ViewRootImpl(17544): #3 mView = null I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false V/ActivityThread(17544): updateVisibility : ActivityRecord{51825e4 token=android.os.BinderProxy@8c7c57f {com.example.fb_login/com.example.fb_login.MainActivity}} show : true W/System.err(17544): remove failed: ENOENT (No such file or directory) : /data/user/0/com.example.fb_login/files/AppEventsLogger.persistedevents I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false I/System.out(17544): (HTTPLog)-Static: isSBSettingEnabled false

1. Can you describe the situation where you have this problem?

2. What is your version of flutter_facebook_login?

3. Can you post your source code?

xiehongxin avatar Oct 10 '19 02:10 xiehongxin