OpenID in PHP with Wordpress

Taral taralx at gmail.com
Thu Jun 30 09:15:18 PDT 2005


On 6/29/05, Clay Smith <srhuevos at gmail.com> wrote:
> I've tried adjusting Taral's script so that it uses the Wordpress login, and
> I think I've got down pretty good, but when I try signing onto Livejournal
> with my server I recieve a "naive_verify_failed_network" error. The script
> is at http://conhuevos.com/openid.txt. Do y'all see something I don't? I may
> just be misunderstanding something.

It's hard to diff (you passed it through indent?), but I think I see
some problems:

$resp = array("mode" => "id_res", "user_setup_url" =>
"http://conhuevos.com/wp-login.php?redirect_to=$ret");

1. You don't want to go back to $ret. You want to go back to this
script to re-try the authentication.
2. user_setup_url is only for checkid_immediate mode. For
checkid_setup mode, just redirect to the user_setup_url directly.

So you want something like what is under the cookie check I have, but like this:

if (wp_login(...)) {

} else {
    $url = "http://$_SERVER[SERVER_NAME]$_SERVER[PHP_SELF]?openid.mode=$mode"
. continuation();
    $url = "http://conhuevos.com/wp-login.php?redirect_to=" . urlencode($url);
    if ($mode == "checkid_immediate") {
        $url = $retp . "openid.mode=id_res&openid.user_setup_url=" .
urlencode($url);
    }
    header("Location: $url");

and then a page (see Login required in my version).

Hope that helps.

-- 
Taral <taralx at gmail.com>


More information about the yadis mailing list