You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried the facebook-cli login and it seems successful (```Waiting to receive authorization code on port 3333...
Received authorization code. Exchanging it for an access token...```) but then whenever I try to do anything else such as facebook-cli me or facebook-cli friends, I get an error message stating that I need to login: `Obtain an access token to interact with the Facebook API.
quite the same issue, I'm still blocked, my problem is: facebook no longer accepts http redirect address, but only https, and there is no way to change facebook behaviors, perhaps from cambridge analytica scandal. I bypassed it copying and pasting the address from terminal to browser and changing the redirect address from http to https, process goes on, and try to push the code to https://localhost:3333 but the script waits on http port, so, on browser window, I have to change https with http and the script receives the code, but when it tries to excange it with a token, the process stops and exit, as nivek wrote.
See, for me, switching it to https for the facebook URL and then switching the local URL to http worked. The problem then was that the login timed out and it doesn't give me an option to log back in.
Correction, I was confusing this with the npm fbcli tool. Oops. I CAN switch it to https for the facebook URL and then switch the local back to http, and it acts like it was successful, but it doesn't actually save.
It looks like I got it working...it's a pain in the neck, but here's the workaround:
https://graph.facebook.com/v2.12/oauth/access_token?client_id={yourappid}&redirect_uri={your redirect URL with port AND TRAILING SLASH}&client_secret={yoursecretid}&code={the part after the code= in the URL from running the login command}
For example, run facebook-cli login and you get the output
Open this URL in a web browser and allow access to the Facebook Graph on behalf of your user account:
Waiting to receive authorization code on port 3333...
Copy the URL into your browser and adjust the redirect to have https instead of http.
It'll redirect to something like "http://192.168.1.5:3333/?code={gibberish}
So, you'd take {gibberish} and insert it above in place of "{the part after the code...}"
That will return an access token and associated info which you'll just need to copy into your ~/.facebook-clirc file without the quotation marks.
DONE ! great job!
Two only advises, just to help, redirect_uri has to have https:// address (I use https://localhost:3333) and when you copy the token in ~/.facebook-clirc, have to delete the { }, the quotation marks and all the rest after the end of the code, and it need one space between colon and the code like this:
access_token: kjwdfuqwgewgwrqgwrqkwuw455436/&%7
now i can post on my timeline but not on my page...but this is one other story, I think it's a problem of permissions for API pages that need special auth from facebook.
update: I'm able to post on my page, maybe it's clear, but the problem was that i received access token for my user, then i went to Graph API explorer and retrieve the token for my page, after changed it in ~/.facebook-clirc, everything went well, so, yes, with some tricks we arrived to the end!
THANK YOU SPECIOUS AND NIVEK !
All new apps created as of March 2018 have this setting on by default and you should plan to migrate any existing apps to use only HTTPS URLs by March 2019.
@specious: It might be worth updating the Facebook setup section of README.md to reflect this change by Facebook.
(And it’s good to know there’s a deadline for when HTTPS will become necessary.)
I am in awe of the creativity you guys have demonstrated here in this thread.
I've returned from hiatus, with ginormous thanks to @btrask for bestowing upon me one of his personal laptops for me to be able to work on. You guys should definitely check out his github projects!
I upgraded facebook-cli login to use HTTPS to listen for the auth code and updated the initial setup instructions, which are now accurate and decidedly much simpler (495d96c). I also pared down facebook-cli's functionality in light of the recent slew of deprecations to the Graph API (d66a192). Certain features now require a formal application review, which regrettably puts facebook-cli users on the sidelines.
Functions removed are:
friends
event, events, pastevents
tagged
post, postlink, postvideo
facebook-cli 1.7.1 is now in rubygems and ready to go.
Activity
pierloca commentedon Mar 29, 2018
quite the same issue, I'm still blocked, my problem is: facebook no longer accepts http redirect address, but only https, and there is no way to change facebook behaviors, perhaps from cambridge analytica scandal. I bypassed it copying and pasting the address from terminal to browser and changing the redirect address from http to https, process goes on, and try to push the code to https://localhost:3333 but the script waits on http port, so, on browser window, I have to change https with http and the script receives the code, but when it tries to excange it with a token, the process stops and exit, as nivek wrote.
specious commentedon Apr 10, 2018
Looks like facebook-cli will need to be updated to use HTTPS during the authentication handshake.
Unfortunately, I currently don’t have a computer to work on. Maybe somebody in the community would like to try to solve this?
nivek1385 commentedon Apr 10, 2018
See, for me, switching it to https for the facebook URL and then switching the local URL to http worked. The problem then was that the login timed out and it doesn't give me an option to log back in.
nivek1385 commentedon Apr 12, 2018
Correction, I was confusing this with the npm fbcli tool. Oops. I CAN switch it to https for the facebook URL and then switch the local back to http, and it acts like it was successful, but it doesn't actually save.
nivek1385 commentedon Apr 12, 2018
It looks like I got it working...it's a pain in the neck, but here's the workaround:
https://graph.facebook.com/v2.12/oauth/access_token?client_id={yourappid}&redirect_uri={your redirect URL with port AND TRAILING SLASH}&client_secret={yoursecretid}&code={the part after the code= in the URL from running the login command}For example, run facebook-cli login and you get the output
Copy the URL into your browser and adjust the redirect to have https instead of http.
It'll redirect to something like "http://192.168.1.5:3333/?code={gibberish}
So, you'd take {gibberish} and insert it above in place of "{the part after the code...}"
That will return an access token and associated info which you'll just need to copy into your ~/.facebook-clirc file without the quotation marks.
pierloca commentedon Apr 13, 2018
DONE ! great job!
Two only advises, just to help, redirect_uri has to have https:// address (I use https://localhost:3333) and when you copy the token in ~/.facebook-clirc, have to delete the { }, the quotation marks and all the rest after the end of the code, and it need one space between colon and the code like this:
access_token: kjwdfuqwgewgwrqgwrqkwuw455436/&%7
now i can post on my timeline but not on my page...but this is one other story, I think it's a problem of permissions for API pages that need special auth from facebook.
pierloca commentedon Apr 13, 2018
update: I'm able to post on my page, maybe it's clear, but the problem was that i received access token for my user, then i went to Graph API explorer and retrieve the token for my page, after changed it in ~/.facebook-clirc, everything went well, so, yes, with some tricks we arrived to the end!
THANK YOU SPECIOUS AND NIVEK !
nivek1385 commentedon Apr 13, 2018
G;ad I could help with the workaround until someone more knowledgeable can help with changing the http to https.
GrimRevenant commentedon Jun 7, 2018
Works for me. Just make sure
Enforce HTTPSis set toNofor your app, underProducts > Facebook Login.Suspect new users are having this problem because, per Facebook documentation:
@specious: It might be worth updating the Facebook setup section of README.md to reflect this change by Facebook.
(And it’s good to know there’s a deadline for when HTTPS will become necessary.)
specious commentedon Aug 10, 2018
I am in awe of the creativity you guys have demonstrated here in this thread.
I've returned from hiatus, with ginormous thanks to @btrask for bestowing upon me one of his personal laptops for me to be able to work on. You guys should definitely check out his github projects!
I upgraded
facebook-cli loginto use HTTPS to listen for the auth code and updated the initial setup instructions, which are now accurate and decidedly much simpler (495d96c). I also pared down facebook-cli's functionality in light of the recent slew of deprecations to the Graph API (d66a192). Certain features now require a formal application review, which regrettably puts facebook-cli users on the sidelines.Functions removed are:
facebook-cli 1.7.1 is now in rubygems and ready to go.