WordPress.org

Ready to get started?Download WordPress

Forums

WPBook Lite
[resolved] Repeatedly being asked to generate new access token (43 posts)

  1. L L
    Member
    Posted 2 years ago #

    I saw your blog post about the deprecation of offline_access and how we'd need to generate a new access token every 60 days, but I'm being repeatedly, every few page refreshes in the WP dashboard, told I need to generate a new token.

    Your Facebook Access Token for WPBook Lite has expired. Please visit the settings page for WPBook Lite and grant a new access token. Until you do so, cross-posting to Facebook and import of comments will fail.

    I generate the new token, and everything seems to go successfully, but a few minutes later I'll get the message to generate a new token again.

    Also, no posts are being published since the most WPBookLite update.

    http://wordpress.org/extend/plugins/wpbook-lite/

  2. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    You are running version 1.4?

    Have you checked to see what the setting is for your Facebook application, under Advanced, Migrations?

    If you have "deprecate offline_access" set to DISABLED, you are only getting "short term" token which expire every 2 hours.

    If you have "deprecate offline_access" set to ENABLED, and you generate a new token, you should get one that doesn't expire for 60 days.

    You can take the token stored (it's visible on the WPBook Lite settings page) and check it here:

    https://developers.facebook.com/tools/debug/access_token

    Just paste in the whole thing and it should tell you what it's expiration date is

  3. minegro Inc
    Member
    Posted 2 years ago #

    Hi,

    I'm having a similar problem in which every time I try to post it goes to a blank screen and when i go to check on the wpbook settings, it says the access token has expired. I re-access the tokens and it seems to work ok but, as soon as i try and post, the access gets revoked again. I have not successfully posted to my FB page or profile since updating. Should I just recreate the app from scratch and do the whole process over? Thanks in advance for your help.

  4. Alith
    Member
    Posted 2 years ago #

    I'm having a similar problem in which every time I try to post it goes to a blank screen and when i go to check on the wpbook settings, it says the access token has expired. I re-access the tokens and it seems to work ok but, as soon as i try and post, the access gets revoked again. I have not successfully posted to my FB page or profile since updating. Should I just recreate the app from scratch and do the whole process over? Thanks in advance for your help.

    Some problem...

  5. L L
    Member
    Posted 2 years ago #

    Hi John,

    I finally got it to take. For some reason, Fb wasn't setting a new access token even though it said it was. It was just returning the same old token to WPBook Lite. So I switched my browser to private browsing mode and pasted the URL into the address bar manually. Finally a new long-lived token was generated! Maybe this was some odd combination of browser caching and/or cookies that was causing the problem? I don't know. I do know I'm happy to have WPBook Lite back in action. Still ticked off that this means we'll have to generate new tokens every 60 days. That doesn't feel like the "frictionless sharing" that Zuckerberg was promoting last Fall.

  6. minegro Inc
    Member
    Posted 2 years ago #

    I finally got it to take. For some reason, Fb wasn't setting a new access token even though it said it was. It was just returning the same old token to WPBook Lite. So I switched my browser to private browsing mode and pasted the URL into the address bar manually. Finally a new long-lived token was generated! Maybe this was some odd combination of browser caching and/or cookies that was causing the problem? I don't know. I do know I'm happy to have WPBook Lite back in action. Still ticked off that this means we'll have to generate new tokens every 60 days. That doesn't feel like the "frictionless sharing" that Zuckerberg was promoting last Fall.

    Neuralgourmet,

    what URL did you paste into the browser? the URL for the access token?

  7. L L
    Member
    Posted 2 years ago #

    what URL did you paste into the browser? the URL for the access token?

    Yes, the URL to generate the access token, from the link on the WPBook Lite settings page.

    https://www.facebook.com/dialog/oauth?client_id=YourFacebookAppIDHere&redirect_uri=http://YourURLHere/?wpbook=oauth&scope=read_stream,publish_stream,manage_pages,user_groups

  8. minegro Inc
    Member
    Posted 2 years ago #

    Yes, the URL to generate the access token, from the link on the WPBook Lite settings page.

    https://www.facebook.com/dialog/oauth?client_id=YourFacebookAppIDHere&redirect_uri=http://YourURLHere/?wpbook=oauth&scope=read_stream,publish_stream,manage_pages,user_groups

    I just tried that as well and I keep getting the same results no posts to my profile or page and the access token error. Not sure what else I can do except completely delete the app, the plug-in and start from scratch.

  9. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    @minegro The difference wasn't pasting the url in, it was that he did it in private mode so no cookies existed - a different browser should do the same.

    Did you switch the migration? (Application settings in Facebook -> advanced -> migrations -> deprecate offline_access must be enabled)

    Otherwise you will only get short lived access tokens

  10. L L
    Member
    Posted 2 years ago #

    @minegro The difference wasn't pasting the url in, it was that he did it in private mode so no cookies existed

    I concur.

    One note I forgot to mention before: 'Deprecate offline_access' was renamed to 'Remove offline_access permission'. Same setting though -- you want it enabled.

  11. green369
    Member
    Posted 2 years ago #

    It's not working :(...

    1. i have set "Remove offline_access permission" to "Enabled" and then waited for 20 minutes

    2. then i tried a different browser ( Crome ) - and delete all cache "from the beginning of time" - and then past the link. I get "Succeeded in saving Access Token Return to your blog"

    3. Then i get back in Firefox and access WPBook Lite Setup - everything seems ok : Stored access token = AAAEeeAiPm....

    4. Then i try to create a new Post and after i press publish ... i get a white screen. After i press F5 ( refresh ) ... i get : "Your Facebook Access Token for WPBook Lite has expired. Please visit the settings page for WPBook Lite and grant a new access token. Until you do so, cross-posting to Facebook and import of comments will fail."

    I am using : WPBook Lite Version 1.4

  12. L L
    Member
    Posted 2 years ago #

    Bloody hell. Now I'm getting the white screen of failure on posting, and WPBook Lite is saying the access token is invalid again. It was working before. :(

    Here's the output from the Access Token Debugger page. You can see I am getting the long-lived tokens.

    Application ID
    204956786281166 : Agnosus
    User ID
    730609720 : Leo Lincourt
    Issued
    1337800548 (2 seconds ago)
    Expires
    1342984548 (in about 2 months)
    Valid	True
    Origin	Unknown
    Scopes	create_note manage_pages offline_access photo_upload publish_actions publish_stream read_stream share_item status_update user_groups video_upload
  13. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    @LL when you visit the WPBook Lite settings page, does it list your access token?

    Are you publishing to a page, or a user profile? WPBook Lite stores a different access token for the page different than for the user - it uses the user token and the manage_pages permission to get a new page token.

    Sorry you're having trouble - it's been working for me, so I'm trying to narrow down what might be different in your case. Thanks for validating the access token.

  14. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    @green369

    After you've published a post and got a white screen, did the post successfully publish? In addition to publishing in WordPress, did it get to Facebook?

    Are you publishing only to a profile or to a group or page?

  15. green369
    Member
    Posted 2 years ago #

    @johneckman

    - i am trying to post to my profile ( not a Facebook page )

    - i have also used https://developers.facebook.com/tools/debug/
    and i get :
    Issued: 1337794526 (4 hours ago)
    Expires: 1342978526 (in about 2 months)
    Valid: True
    Origin: Web

    - after the "white screen" the post didn't get to Facebook but it appears in my WordPress site ( the post was successfully published to WordPress but NOT in Facebook )

    - before posting in WordPress the access token is listed in WPBook Lite settings page, but after i publish a new post i get "Stored access token = invalid" ( and the post is not getting to Facebook )

  16. L L
    Member
    Posted 2 years ago #

    Are you publishing to a page, or a user profile?

    John, I'm publishing to my personal profile.

    Sorry you're having trouble - it's been working for me

    No worries. It's just frustrating because it *was* working for me too.

    FYI: When I post in WP, I get the white screen, but the post is successfully published. Nothing shows up in my Activity Log on Fb. Haven't had time to look at the WPBook Lite log.

    A thought: Usually the "white screen" in WP means PHP ran out of memory, or timed out. The site I have my blog on though should have enough memory. When I get a chance, probably tomorrow, I'll try increasing the memory limit for PHP and see if that helps.

  17. minegro Inc
    Member
    Posted 2 years ago #

    John,

    so, I did catch the bit about private browsing. Sorry I didn't mention it in the last post. My FB migration settings are as they should be as well. I've tried it in several browsers and have reset each browser before trying to generate the tokens. I even completely deleted the app from Facebook, deleted the plugin from WP, reset all browser data and, re-installed/created everything from scratch to no avail. Still exactly the same issue.

    1) successfully generate tokens for both my profile and page.
    2) save everything
    3) write a post /publish
    5) the great white death
    6)refresh page
    7) WPbooklite says "access token invalid"
    8) post shows up on WP, not on FB and/or page.

    Could FB have a cache for these tokens once you set them up or something? Maybe I'll try creating a completely different app and trying to link to it. Not sure what else to do. The plugin doesn't seem to work for me at all. Not knocking the Plug-in, i've used it since you created it and LOVE it.

  18. jazzfanatic
    Member
    Posted 2 years ago #

    I am having the same issue and have tried every browser, multiple facebook accounts, made a new facebook etc. It has the white screen after posting and then there are no errors anywhere in the logs in apache and the token is then said as being expired. When I debug the token in facebook it says it will last for 2 months. As of not the plugin does not work at all.

  19. ryan.taylor
    Member
    Posted 2 years ago #

    Looking for the right plugin to publish posts to my Facebook page when they're published on my site and having no luck because of these cursed access token expiration problems. I've followed the steps in this thread and it keeps failing.

    Is this just an issue with this plugin in the last few days?

    It also invalidates access token and locks on the white screen when "Publish this post to Facebook Wall" = No. The only way that I can avoid it is by disabling the plugin.

    Please help, I would really like this plugin to be the one.

  20. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks all for your help debugging this - turns out there was a bug in 1.4 - a simple mistake in a variable name*.

    I've just tagged and released 1.4.1 which should be available by the time you read this - please upgrade immediately.

    After you upgrade to 1.4.1, go look at your WPBook Lite settings page. If it shows a valid access_token you should be fine with no further effort. If it currently shows "invalid" for access token you will need to generate a new one once more.

    *The bug was such that any attempt to publish to Facebook was invalidating the access token. Somehow I introduced this mistake after uploading the test version to my test blog, which is why I wasn't seeing it. Sorry.

  21. minegro Inc
    Member
    Posted 2 years ago #

    John,

    Thanks for the update! It publishes to my FB profile now but I get the following error after it's published.

    Caught exception for page access token: Unsupported get request.Error code: 0

    It does not publish to my page. Is this a WP issue not related to the plug-in? SOrry, I'm a bit of a good to all of this and am still learning the basics.

  22. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    @minegro Inc - can you open a new thread for this separate issue.

    Didn't see this at the bottom of this thread.

    To put in that post:

    What is the page id to which you are trying to publish?

    Do you have debugging enabled? If so, what turns up in the debug.txt?

    Do you have a page access token shown on your WPBook Lite settings page? Have you validated it using the Facebook token debugger?

  23. mmorrow4393
    Member
    Posted 2 years ago #

    Hi, I am having the same problem as above: get the token, write a post, get a white screen, go back to wp admin, and then the error message (Your Facebook Access Token for WPBook Lite has expired. Please visit the settings page for WPBook Lite and grant a new access token. Until you do so, cross-posting to Facebook and import of comments will fail.) "Remove offline_access permission is Enabled. I also set up an Auth Dialog because it seemed to require.

    Just doesn't seem like the token is being stored.

    The site is http://westtexaspictures.com, the user is http://www.facebook.com/mark.short.338.

    Please advise.

  24. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    @mmorrow4393

    Assume you are running the latest WPBook Lite - 1.4.3? If not, upgrade first.

    Immediately after granting a new token (but before trying to publish a new post with it), go and look at your WPBook Lite settings page. Copy the token stored there, and check it with the Facebook Access Token Debugger: https://developers.facebook.com/tools/debug/access_token

    Most likely what's happening is that Facebook is still sending short lived access tokens. You may need to deauthorize the application (go into your Facebook account settings, find your WPBook app, and remove all permissions / remove it from your profile). Then re-add the application, which should generate a truly NEW access token.

  25. mmorrow4393
    Member
    Posted 1 year ago #

    Hi John,

    I tried all of the above and it is still occurring. The debugger said the token was good for two months. I also deactivated and deleted the WPBook Lite and downloaded a clean version. This same behavior:

    1) successfully generate tokens for my profile.
    2) save everything
    3) write a post /publish
    5) the great white death
    6) refresh page or go back
    7) WPbooklite says "access token invalid"
    8) post shows up on WP, not on FB and/or page.

    I did check the following but do not know how to access these:
    Enable WPBook to create a debug file
    Show errors posting to Facebook Stream

    The site is http://westtexaspictures.com, the user is http://www.facebook.com/mark.short.338.

    Please advise.

  26. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    mmorrow4393 - sorry to hear you're having issues.

    I assume you are running 1.4.3?

    To what targets are you publishing? (Personal profile wall, page, and or group?)

    At step 2, when you say "save everything," can you go back to your WPBook Lite settings page and check your token(s)? (you may have one for profile and one for page, depending on what you are publishing to).

    To check your debug file, look inside wp-content/plugins/wpbook-lite/ and see if there is a debug.txt file there, which will have some detail in it about what is happening.

    All I can imagine is that there's some confusion between the individual profile and a page ID - the place where WPBook asks for YOUR profile ID it should an individual profile not a page.

    Was it working for you before?

  27. JnManso
    Member
    Posted 1 year ago #

    Hi. I'm suferrig from this error, but also have this warning message.

    Permissions for pages

    You've indicated you wish to publish to this page: XXXXXXXXXXXX

    Could not get accounts list from Facebook. The access token could not be decryptedError code: 0

  28. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    That means there's something wrong with your access token for your Profile.

    WPBook is trying to use your personal access token to find out what pages your profile has access to publish to.

    Are you sure your settings are correct for YOUR profile ID and page ID?

    Profile ID must be provided even if you don't plan to publish to your profile.

  29. JnManso
    Member
    Posted 1 year ago #

    Hi, The WPBook Lite is working perfectly for +- 2 months and the errors above appeared (the access token invalid and the decrypt error). Something changed and was not my configuration.

  30. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    JnManso - sure. Facebook changes things in their API all the time. WPBook Lite does get updated from time to time, in order to keep track with their API updates.

    I'm just telling you that the error you report: "Could not get accounts list from Facebook. The access token could not be decrypted" - which has been returned by Facebook, means WPBook Lite is for one reason or another getting a bad access token for the account set as YOUR profile ID.

    When you visit your WPBook Lite settings page in WordPress, does it tell you it has stored an access token for your personal profile?

    Can you check that access token in the Facebook tool for checking access tokens and see if it is valid?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic