up until 4 days ago this was working just fine, now I keep receiving an error when trying to post a youtube video on my friends (or even my own) wall.
Reading user ids from list.txt and send them a video
Posting video to user id: me
{"error":{"type":"OAuthException","message":"Error validating application."}}
I am getting the same error with an application which i created on a friends facebook account when trying to do the same thing.
Does anyone have an idea why this is and what I can do to fix it?
Thank you!
I started getting this problem for some of my users on my app recently. It was because my database field for storing oauth tokens was limited to 100 characters, which in the past has been long enough for facebook oauth tokens. Newer tokens are sometimes longer than that.
Just a guess...
I have suddenly started getting this on working code too. I have traced the API URL the PHP SDK is calling and it does have an access token in. The PHP SDK errors with 'An active access token must be used...' and calling the URL it called manually results in 'Error validating application.'
Related
I have an access token and the following url:
https://graph.facebook.com/v2.5/414950271951116?fields=posts.limit(50).until(1451606399).since(1420070400)%7Bmessage%2Ccreated_time%7D&access_token= INSERT APP TOKEN
Originally I made an app token which could make requests for 60 days. It seems that it's not working now. Is anyone else having this issue or am I doing something wrong? I don't seem to get any error messages.
it was my mistake. It seems that this particular user has blocked people from using the API on their Facebook page.
I'd like to preface our problem by saying we are using a server side flow to get the oauth tokens, therefore getting long lived tokens by default.
The problem: We've noticed through newer users that when they log out of facebook(from anywhere) the oauth tokens we have saved for them become deauthorized. However my facebook account, and others at our company, are not deauthorized when they log out. What could account for this difference?(Note: On my facebook account I've tried removing our application so I could 'start from scratch' so I don't have offline_access or anything like that).
Ideally our users would not be deauthorized when they log out.
Thanks for any insight,
Luke
EDIT: These tokens also expire within a couple hours. it seems like we might be getting short lived tokens even though we are obtaining them through the server side?
It seems there was an issue with application within Facebook, we created a new application listing in Facebook and migrated to using this new client id and we have not seen the error since.
Just responding here in case anyone else encounter this issue.
I was creating a facebook application and a security prompt came up which asked me to verify my mobile number and email. Unfortunately the mobile number was an old one and the email was my old university one (bad foresight..) which has expired.
Facebook are suspicious of new accounts developing facebook applications because they believe people are making the accounts for the sole purpose, so my only opportunity is to use my friends account to re-register my app.
I have registered the app and taken the new app id and secret and put them into my application config.php file. However the below error is appearing:
"Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in C:\xampp\htdocs\MY FOLDER NAME\fb\base_facebook.php on line 1028"
I have replaced every instance of where my app id and secret were used to I don't understand what could be difference between the two...
Any thoughts?
The access token error will be shown when you are trying to access certain information which is not readily accessible without getting access to that user's access token. Thus this does not look like a appid config issue. Try the graph api explorer tool to see if the request goes through
https://developers.facebook.com/tools/explorer
Also you seem to be using Facebooks test code , you can also test it with some basic Facebook javascript sdk code from here
https://developers.facebook.com/docs/reference/javascript/
Also there is getting started code here for php
https://developers.facebook.com/docs/appsonfacebook/tutorial/#auth
Try and see if these work for you that will confirm whether the appid is issue or not.
A while ago I had written some code that searched Facebook events using the api. I've been trying to revive that code but have been unsuccessful. The main difficulty I see is that is that searching for public events now seems to require an access token. The documentation (https://developers.facebook.com/docs/reference/api/event/) says that shouldn't be the case until July 5th but, the sample event search for me (https://graph.facebook.com/search?fields=name&q=conference&type=event) returns nothing if you don't have an access_token.
So I got an access_token for my application using the facebook php sdk $facebook->getAccessToken(). The problem I am now suffering is this seems to be the wrong type of token. It doesn't work to return any events and the query when posted into the url bar doesn't get anything, but if I switch it an access token generated by a learn graph api link the query works in the url bar (but not from my site annoyingly enough). The type of access token I'm getting from the app is basically | and that is the type that is not working for the event search.
I am basically looking for any advice I can get. How to get an access token that the event search will accept would be helpful. I also find it weird that I can do an event search using the url bar but, the exact same query through my app returns an empty array. So basically anything that can shed some light on my problems would be great.
UPDATE:
I got everything working except that it still requires a user access token rather than an app access token (or none). My other problem was caused by an oddity in the php sdk and I was able to solve it by just doing the curl queries myself.
I have the same problem, at this moment I'm using the access token the graph API explorer (https://developers.facebook.com/tools/explorer) uses when my app is selected (I think it's the users's token so the app can beave as the user, and since it's my access token it's not a big deal).
But this raise another problem: I think the token gets invalidated by logging off from FB or anything similar.
We have a Canvas Facebook App and for some time we get a strange error for some of the users that are trying to install (allow) our Facebook app. I mention this is happening only for some of the users and not for all! The error we are getting is "The remote server returned an error: (400) Bad Request." The graph API call we putted in a try catch block and this is what the logs says when I searched over them to see what went wrong. The graph API call is:
https://graph.facebook.com/oauth/access_token?client_id=XXX&redirect_uri=XXX&client_secret=XXX&code=code_received_from_facebook.
We received the code from Facebook and append it to the graph API call from above but it seems that for some users this is not working. Our redirect_uri parameters contains an URL to our Facebook App and contains also some parameters (example: http://apps.facebook.com/our_application_URL?cid=xxx&surveyid=xxx&messageid=xxx).
xxx = some values.
Did some of you confront with this kind of strange behavior? Working for some users but for other is not working? We are using the same code so nothing change between a successful installation and a unsuccessful installation.
Thank you for your help in advance!
Now that Facebook require SSL for applications your "redirect_uri" need to be https (i.e https://apps.facebook.com/myapp/), otherwhise you will get "Bad Request".
You probably got the error for only the users that had forced SSL but not the rest.