WP -> XF user sync not working

Discussion in '[bd] API' started by Marvin Herbold, Jan 9, 2015.

  1. Marvin Herbold

    Marvin Herbold New Member

    WordPress 4.1 with XenForo API Consumer 1.1.0
    XF 1.4.3 with [bd] API 1.2.1b

    The only thing I need to work is user sync. My users all have WP accounts, and they need to sync with XF for seamless login.

    I have the WP XenForo API Consumer settings all set and it says "All required API modules have been found." The only options I have turned on in the settings are "Sync logged-in cookie" and "Create XenForo account for Wordpress User".

    The API Key and API Secret match.

    I have [bd] API: Create Client set to "Allow" for the Administrative, Moderating, Registered, and Unregistered / Unconfirmed user groups.

    I can see the Logs under [bd] API getting entries added with no errors reported (e.g. "POST /forums/api/index.php?users/") and I can clearly see the username being passed into the Request array along with a password.

    However, the user is not created in XF, which is the main issue I am struggling with right now.
     
  2. Marvin Herbold

    Marvin Herbold New Member

    Today when someone tried to log into our WordPress site, he got an error from the XF site. I checked the logs for the [bd] API and this is what it says (I changed the IP address and the name of the User for privacy):

    GET /forums/api/index.php?tools/login&oauth_token=2%2C1421073091%2Ca9143478a53ad015f667318381f1f9d9%2C0buqax3ruo&redirect_uri=index.php

    Client: Our Wordpress Site
    User: John Doe
    x.x.x.x, 7 minutes ago
    Request
    array(5) {
    '_origRoutePath' =>
    string(11) "tools/login"
    '_matchedRoutePath' =>
    string(11) "tools/login"
    'tools/login' =>
    string(0) ""
    'oauth_token' =>
    string(56) "2,1421073091,a9143478a53ad015f667318381f1f9d9,0buqax3ruo"
    'redirect_uri' =>
    string(9) "index.php"
    }

    Response (403)
    array(1) {
    'error' =>
    string(68) "You do not have permission to view this page or perform this action."
    }
     
  3. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    This is by design. The WordPress plugin can only log user into WordPress after user has logged into XenForo themselves. In future version, there is a new option to create XenForo account for WordPress user but that can be done when user log in with username/password only (does not work if user checked remember sometime in the past). This is required because both system does not store password in their databases making it impossible to sync passively.

    It has been planned to write a script to push user from WordPress to XenForo but the no password issue is still unsolved for now...
     
  4. Marvin Herbold

    Marvin Herbold New Member

    OK - I think I am confused. You are saying that we need to change our home page so that the user is always signing in via XF and not WP, correct? That will make a single sign-in possible for both XF and WP? The whole point of doing this for us is we want users to only need to log in once and get access to both the XF and WP sides of our site, without having to log in twice.
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @Marvin Herbold Yes, let user log into XenForo first can solve the issue. Or you can ask existing WordPress user to log out and log in back to have their account sync'd to XenForo (this needs newer version of the bridge, which is under beta testing now).
       
Loading...