OpenID2 つうか Yadis はじめました
うーむよくわからん。
わしはwww.yahoo.comにアカウントあるはずやからよしなにやってくれ、と言うと、へいへいと言って調べにいく。
$ telnet www.yahoo.com 80 Trying 209.131.36.158... Connected to www.yahoo.com (209.131.36.158). Escape character is '^]'. HEAD / HTTP/1.1 Host: www.yahoo.com HTTP/1.1 200 OK Date: Mon, 18 Feb 2008 11:53:37 GMT P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV" Cache-Control: private Vary: User-Agent X-XRDS-Location: http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds Last-Modified: Mon, 18 Feb 2008 11:38:26 GMT Accept-Ranges: bytes Content-Length: 9533 Connection: close Content-Type: text/html; charset=utf-8 Connection closed by foreign host.
↓
ここをみろ→http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds
ということなので見に行く。
$ telnet open.login.yahooapis.com 80 Trying 68.180.220.62... Connected to open.login.yahooapis.com (68.180.220.62). Escape character is '^]'. GET /openid20/www.yahoo.com/xrds HTTP/1.1 Host: openid.login.yahooapis.com HTTP/1.1 200 OK Date: Mon, 18 Feb 2008 11:55:16 GMT P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV" Last-Modified: Fri, 01 Feb 2008 22:10:32 GMT Accept-Ranges: bytes Content-Length: 418 Connection: close Content-Type: application/xrds+xml <?xml version="1.0" encoding="UTF-8"?> <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns:openid="http://openid.net/xmlns/1.0" xmlns="xri://$xrd*($v*2.0)"> <XRD> <Service priority="0"> <Type>http://specs.openid.net/auth/2.0/server</Type> <Type>http://specs.openid.net/extensions/pape/1.0</Type> <URI>https://open.login.yahooapis.com/openid/op/auth</URI> </Service> </XRD> </xrds:XRDS> Connection closed by foreign host.
↓
https://open.login.yahooapis.com/openid/op/authが
をサービスしてますよ、ってことらしい。
↓
じゃーパースしますかということでNet::OpenID::Consumerにいくと、
my @services = $yadis->services( OpenID::util::version_2_xrds_service_url(), OpenID::util::version_2_xrds_directed_service_url(), OpenID::util::version_1_xrds_service_url(), ); foreach my $service (@services) { if ($service->Type eq OpenID::util::version_2_xrds_service_url()) { # We have an OpenID 2.0 end-user identifier $id_server = $service->URI; $delegate = $service->extra_field("LocalID"); $version = 2; } elsif ($service->Type eq OpenID::util::version_1_xrds_service_url()) { # We have an OpenID 1.1 end-user identifier $id_server = $service->URI; $delegate = $service->extra_field("Delegate", "http://openid.net/xmlns/1.0"); $version = 1; } elsif ($service->Type eq OpenID::util::version_2_xrds_directed_service_url()) { # We have an OpenID 2.0 OP identifier (i.e. we're doing directed identity) $id_server = $service->URI; $version = 2; # In this case, the user's claimed identifier is a magic value # and the actual identifier will be determined by the provider. $final_url = OpenID::util::version_2_identifier_select_url(); $delegate = OpenID::util::version_2_identifier_select_url(); } }
だけどここで$service->Typeをeqで受けていて先に進めてないぽ。というところまでわかった。
資料
ゴール
Apache2::AuthenOpenID を OpenID2に対応させたい。