1

what i want to achieve is, user login in my wordpress website and also login on vanilla forum, i have installed jsconnect plugin in vanilla forum, and using the php's jsconnect library from following location jsConnectPHP

Here is my code:

require_once('functions.jsconnect.php');

$clientID = "1501569466";
$secret = "xxxxxxxxxxxxxxxxxxxxxx";

$userD = array();

if( isset($_POST['log']) ){
    $data = array();
    $data['user_login'] = $_POST['u_user'];
    $data['user_password'] = $_POST['u_pass'];
    $data['remember'] = TRUE;

    $user = wp_signon($data, FALSE);

    if(!is_wp_error($user)){
        $userD['uniqueid'] = $user->ID;
        $userD['name'] = $user->user_login;
        $userD['email'] = $user->user_email;
        $userD['photourl'] = '';

        $secure = true;
        WriteJsConnect($user, $_GET, $clientID, $secret, $secure);
        $redirect = "http://localhost/vanilla/entry/jsconnect?client_id={$clientID}";

        echo "<script>document.location.href='".$redirect."';</script>";
    }
}

when the user login on wordpress i redirect it to jsconnect url in vanilla where i just found only a progress image, and can't figure out where is the problem..

4

1 回答 1

1

jsconnect 身份验证 url 需要jsonp如下数组:

test({"email":"test@test.com",
      "name":"testuser",
      "photourl":"",
      "uniqueid":1234,
      "client_id":"12345678",
      "signature":"XXXX"})  

您在 jsconnect 中指定的授权 url 应该会看到此输出以进一步处理。事实上,我被困在了这一点上。加载时我可以看到香草论坛收到此输入,但没有登录发生。

于 2013-02-27T08:48:10.097 回答