openid キャプチャ

はてなスターのログインをTypeKeyopenidで代行できるとのこと、
使ってみて、パケットキャプチャしてみた。

しかし、既にはてなにログイン中だったので上手くopenidによるログインが実行できなかったかも。
スターも付かなかった。
とりあえずメモしておく。
一部伏せ字

1. Add star ボタンをクリック(59.106.108.97 への GET 送信)

GET /star.add.json?uri=http%3A%2F%2Fd.hatena.ne.jp%2FXXXXXXXXXXXXXXXXX&title=XXXXXXXXXXX&quote=&location=http%3A%2F%2Fd.hatena.ne.jp%2FXXXXXXXXXXX&callback=Ten.JSONP.callback&Sat%20Mar%2008%202008%2022:52:35%20GMT+0900 HTTP/1.1
Host: s.hatena.ne.jp
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ja; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Accept: */*
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://d.hatena.ne.jp/XXXXXXXXXXXXXXXXXXX
Cookie: b=$1$QiiwQ0tS$FVgdH7mEEdOBUhxO4MKJs0

2. はてなサーバ1(59.106.108.97)からの応答

HTTP/1.1 200 OK
Date: Sat, 08 Mar 2008 13:52:21 GMT
Server: Apache/2.2.3 (CentOS)
P3p: CP="OTI CUR OUR BUS STA"
Content-Type: application/json;charset=utf-8
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 803
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

Ten.JSONP.callback({"html":'\n<form action="https://www.hatena.ne.jp/extlogin" method="post">\r\n<table class="config" style="border: none; margin: 8px 8px;">\r\n  <tr>\r\n\t<td colspan="2" style="text-align: center; padding-bottom: 10px;"><img src="http://s.hatena.com/images/star.gif" alt="star" />\u3092\u3064\u3051\u308b\u306b\u306f\u307e\u305a\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002</td>\r\n  </tr>\r\n  <tr>\r\n    <th class="row" style="background-color: #f3f3f3; width: 150px; color:#000; padding: 5px;">\u30b5\u30fc\u30d3\u30b9\u540d</th>\r\n    <td>\r\r\r\n\t  <select name="provider">\r\n\t\t<option value="hatena">\u306f\u3066\u306a</option><option value="livedoor">livedoor</option><option value="livejournal">LiveJournal</option><option value="vox">Vox</option><option value="typekey">TypeKey</option>\r\n\t  </select>\r\n\t</td>\r\n  </tr>\r\n  <tr>\r\n    <th class="row" style="background-color: #f3f3f3; width: 150px; color:#000; padding: 5px;">\u30e6\u30fc\u30b6\u30fc\u540d</th>\r\n    <td><input value="" name="name" id="login-name" class="text" type="text" style="width: 13em;" /></td>\r\n  </tr>\r\n</table>\r\n<div class="config-button" style="text-align: center">\r\n  <input checked="checked" value="1" name="persistent" class="checkbox" id="auto_login" type="checkbox" />\r\n  <label for="auto_login">\u6b21\u56de\u304b\u3089\u81ea\u52d5\u7684\u306b\u30ed\u30b0\u30a4\u30f3</label><br />\r\n  <input value="\u9001\u4fe1" class="submit" type="submit" />\r\n</div>\r\n</form>\r\n',"errors":["<p><img src=\"http://s.hatena.com/images/star.gif\" alt=\"\u2606\" width=\"11\" height=\"10\" />\u3092\u3064\u3051\u308b\u306b\u306f\u307e\u305a\u306f\u3066\u306a\u30b9\u30bf\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002</p><p><a href=\"https://www.hatena.ne.jp/login?location=http://s.hatena.ne.jp/\">\u306f\u3066\u306a\u30b9\u30bf\u30fc\u306b\u30ed\u30b0\u30a4\u30f3</a></p>"],"name":"","is_guest":1});

CentOSなんだ

3. はてなサーバ2(59.106.108.86)へのTLS接続、暗号化データ送受信

4. TypeKeyサーバ(204.9.178.26)へのTLS接続、暗号化データ送受信

5. はてなサーバ2(59.106.108.86)へのHTTP接続

GET /extlogin?persistent=1&location=http%3A%2F%2Fd.hatena.ne.jp%2FXXXXXXXXXXX&oic.time=1204984352-d239db5e0c7b121d49c6&openid.mode=id_res&openid.identity=http://profile.typekey.com/yamdan/&openid.return_to=http://www.hatena.ne.jp/extlogin%3Fpersistent%3D1%26location%3Dhttp%253A%252F%252Fd.hatena.ne.jp%252FXXXXXXXXXXXXXXX%26oic.time%3D1204984352-d239db5e0c7b121d49c6&openid.assoc_handle=1204907000:6zDYU306IM9Yz4HcUQOO:e4a9b0bd34&openid.signed=mode,identity,return_to&openid.sig=9EVtll8bgcN7nZ/8pckdFtRShVY%3D HTTP/1.1
Host: www.hatena.ne.jp
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ja; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://d.hatena.ne.jp/XXXXXXXXXXXXXXXXXXXXXXXXXXX
Cookie: b=$1$QiiwQ0tS$FVgdH7mEEdOBUhxO4MKJs0

6. TypeKeyサーバ(204.9.178.26)から暗号化データを受信(on TLS)

7. はてなサーバ2(59.106.108.86)からのHTTP応答

HTTP/1.1 200 OK
Date: Sat, 08 Mar 2008 13:52:35 GMT
Server: Apache/2.2.3 (CentOS)
P3p: CP="OTI CUR OUR BUS STA"
X-Framework: Ridge/0.04
Content-Type: text/html;charset=utf-8
Set-Cookie: rk_external=6ef784f5fdfb8be91d984bfb4e8657e6d72f0dc6; domain=.hatena.ne.jp; path=/; expires=Mon, 07-Apr-2008 13:52:33 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 670
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <link rel="stylesheet" href="/css/base.css" type="text/css" media="all">
    <link rel="stylesheet" href="/statics/css/hatena-www-jp.css" type="text/css" media="all">
<meta http-equiv="Refresh" content="1;URL=http://d.hatena.ne.jp/XXXXXXXXXXXXXXXXXX" />

</head>
<body
   id="hatena-www-extlogin"
   >
<div id="header" align="left">
  <div id="logo"><a href="/"><img src="/statics/images/logo-hatena-global.gif" alt="Hatena" title="Hatena" id="logo-hatena" /></a></div>
</div>
<div id="container">
  <div id="body">
    <div class="progress-message">
      <p><span>yamdan@typekey </span></p>
      <div class="note">
        <a href="http://d.hatena.ne.jp/XXXXXXXXXXXX"></a>
      </div>
    </div>
  </div>
</div>
    <div id="copyright">Copyright (C) 2001-2008 hatena. All Rights Reserved.</div>
  </body>
</html>

8. はてなサーバ1(59.106.108.97)へのHTTP送信

GET /entries.json?uri=http%3A%2F%2Fd.hatena.ne.jp%2FXXXXXXXXXXX&callback=Ten.JSONP.callback&Sat%20Mar%2008%202008%2022:52:53%20GMT+0900 HTTP/1.1
Host: s.hatena.ne.jp
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ja; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Accept: */*
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://d.hatena.ne.jp/XXXXXXXXXXXXXXXXXXXXXXX
Cookie: b=$1$QiiwQ0tS$FVgdH7mEEdOBUhxO4MKJs0; rk_external=6ef784f5fdfb8be91d984bfb4e8657e6d72f0dc6

9. はてなサーバ1(59.106.108.97)からのHTTP応答

HTTP/1.1 200 OK
Date: Sat, 08 Mar 2008 13:52:41 GMT
Server: Apache/2.2.3 (CentOS)
P3p: CP="OTI CUR OUR BUS STA"
Content-Type: application/json;charset=utf-8
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 201
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

Ten.JSONP.callback({
(略)