2

Yahoo の openidcheck_authenticationが常に返さis_valid:false れるパラメータがいくつかありませんか?

https://open.login.yahooapis.com/openid/op/auth?
openid.assoc_handle=xAS_t.4jTdUdsshHxy2bcoP4XRDBZ3JtfMwc2Otwbw0V3AhEVUg9FF0t.1jZp65mk8Oqf8ZypMZlRMWLP1_Yj44SO16NTlq9cmOq1ls_evue_5ltKPQDMAJo7gNrKe8-
&openid.claimed_id=https://me.yahoo.com/a/CHxd29Etm54Hzrq4_oQ_RSiba_x.k4uA#47ac6
&openid.identity=https://me.yahoo.com/a/CHxd29Etm54Hzrq4_oQ_RSiba_x.k4uA
&openid.mode=check_authentication
&openid.ns=http://specs.openid.net/auth/2.0
&openid.op_endpoint=https://open.login.yahooapis.com/openid/op/auth
&openid.response_nonce=2012-04-05T07:23:23ZsCfrX0VBTKMuHhly34RkZH_wnq887IVClA--
&openid.return_to=http://voxiternal.com/bong/open/verify/yahoo
&openid.signed=assoc_handle,claimed_id,identity,mode,ns,op_endpoint,response_nonce,return_to,signed,pape.auth_level.nist
&openid.pape.auth_level.nist=0
&openid.sig=eymoRtkcrb2EbQVAlF+DdbAb2oM=
&openid.realm=http://voxiternal.com

check_authenticationはGoogleと完全に連携しています。しかし、Yahooではありません。CURLOPT_POSTFIELDS最初に、Google では機能するが Yahoo では機能しないものを試しました。次に、GET Params に変更しようとしましたが、まだ機能していません

私のPHPコードを添付していますcheck_authentication

public static function authenticate($request){
    $keys = explode(',', $request['openid_signed']);
    foreach($keys as $key){
        $params['openid.'.$key] = $request['openid_'.str_replace('.', '_', $key)];
    }
    $params['openid.ns']           = $request['openid_ns'];
    $params['openid.signed']       = $request['openid_signed'];
    $params['openid.sig']          = $request['openid_sig'];
    $params['openid.assoc_handle'] = $request['openid_assoc_handle'];
    $params['openid.mode']         = 'check_authentication';
    $params['openid.claimed_id']   = $request['openid_claimed_id'];
    $url = $request['openid_op_endpoint'];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_VERBOSE, 1); 
    curl_setopt($curl, CURLOPT_HEADER, 1);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
    $res_buff = curl_exec($curl);
    curl_close($curl);
    list($headers, $body) = explode("\r\n\r\n", $res_buff, 2);
    while(strpos($headers,"100 Continue")!==false){
        list($headers, $body) = explode("\r\n\r\n", $body , 2);
    }
    $headers = self::disect($headers);
    $body = self::disect($body);
    if(!isset($headers['HTTP/1.1 200 OK']))
        return -2;
    if(!isset($body['is_valid']))
        return 0;
    return $body['is_valid'];
}

-> このソリューションは、すべての openid プロバイダーで適切に機能しています。check_authentication だけが Yahoo では機能しません。そのため、他のすべての部分を不安定にして、openid ライブラリに移行するつもりはありません。

編集

数時間の闘争の後、数日前に機能したため、現在問題を抱えているYahooのようです。ただし、署名によるcheck_authentication検証は機能します。hmac_sha1ただしcheck_authentication、google、aol で動作するため、常に false を返します。

誰かがcheck_authentication自分のツール/ライブラリで署名検証を行うことができれば、それは素晴らしいことです。

4

0 に答える 0