WordPress.org

Ready to get started?Download WordPress

Forums

WPBook Lite
Multisite WPBook Lite not storing access token (3 posts)

  1. wsitch
    Member
    Posted 1 year ago #

    Hi John,

    My wife and I share one installation of wordpress.org configured as a multisite. We would like to link each site to a different facebook profile, but the access token returned by facebook isn't being stored.

    We're using WPBook Lite (no https) and have setup applications in facebook. We configured as recommended in your documentation and when we click the "Generate Access Token" we have given approval for the app to access our data.

    The generate access token is referencing the appropriate client_id, redirect_uri, and scope:
    https://www.facebook.com/dialog/oauth?client_id=444191075643743&redirect_uri=http://sara.sitch.org/%3Fwpbook=oauth&scope=read_stream,publish_stream,manage_pages,user_groups

    Facebook comes back with what looks like the token in the URL which reloads the appropriate multisite page (sara.sitch.org in this case), but there is no "token saved" message and the WPBook Lite isn't showing a token is stored.

    Here's the return URL (code changed):
    http://sara.sitch.org/?wpbook=oauth&code=AQAfRnfrpgjxKNYk8s0M38e1lOfLmEh1ztTR0IZT3rtrXF92OLPfNblNQrZalVtRhZzHeff1s7Kfjl6JIKmOajNcJxJKE28K6efArAcRNDOMEBRSwCIZMYTApGhG_eaeLkcWYh9XNlDIKB2gPUMcxChTJIcGUaF3uHky80_ra#_=_

    Thoughts?

    Will
    will@sitch.org

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

  2. wsitch
    Member
    Posted 1 year ago #

    Ok, after some poking around I found what looks like the problem.

    Line 640 of wpbook-lite.php calls wp_remote_request. It never returns, anything after this line doesn't get executed on my system.

    I added "echo $token_url;" into a new line just before the wp_remote_request call, and I see this:
    https://graph.facebook.com/oauth/access_token?client_id=2205(id)875&redirect_uri=http://will.sitch.org/%3Fwpbook=oauth&client_secret=a48b1a(secret)be0&code=AQBJ9dsdhG(code)W1Q7XSCzE4

    It looks right, but there's no error message, code just isn't evaluated after this line.

    From the website I see the page of my multisite blog that I'm trying to match to my facebook account with the URL encoded as follows:
    http://will.sitch.org/?wpbook=oauth&code=AQBJ9dsdhG(code)W1Q7XSCzE4#_=_

    I don't know what those last four characters are. I don't know why wp_remote_response is failing without throwing an error. Could this be related to some Curl failure?

    I'd really like some help here!

    Thanks,
    Will

  3. johneckman
    Member
    Plugin Author

    Posted 8 months ago #

    Hmm. To be clear, WPBook (and WPBook lite) weren't really intended to be used in a multisite instance.

    But that doesn't help solve the problem, just makes it clear I never tested for it.

    Can you try 1.5.4 and see if you have the same problem?

    Note that this whole function relies on wpbook_query_vars to parse the token out of the response.

    Not sure what else might be failing here - let me know if you're still pursuing this option

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.