iosfacebookfacebook-graph-apioauth

Check OAuth Facebook token from iOS client on server/API


I have an iOS application that connects via Facebook (FBSDK). The authentication is successful on the app and I can check FBSDKAccessToken.currentAccessToken().

My iOS app is communicating with a Node API, and I would like to send the Facebook tokens and check they are valid in every request.

My currentAccessToken on the iOS client looks like: 0x12de32171 I've been trying to check it from https://graph.facebook.com/me?access_token=0x12de32171 but I have this error every time:

"Invalid OAuth access token." .


Solution

  • FBSDKAccessToken.currentAccessToken() is an object. To get the token string, it's FBSDKAccessToken.currentAccessToken().tokenString

    Then https://graph.facebook.com/me?access_token=YOUR_TOKEN_HERE works totally fine