developer's diary

最近はc#のエントリが多いです

mixiのopenID

今月に公開されたmixi Developer CenterのOpenID。
早速Google App Engine上でmixi OpenIDを使ってユーザ認証をするサンプルコード - yanbe.diff - subtechでサンプルコードが紹介されていたので、ローカル環境で確認。






ローカル環境のアプリにコールバックされてパラメータが表示されるのだが、

janrain_nonce: 2008-08-24T14:51:22ZCfHIT2
openid.mode: id_res
openid.claimed_id: https://id.mixi.jp/736572
openid.identity: https://id.mixi.jp/736572
openid.op_endpoint: https://mixi.jp/openid_server.pl
openid.return_to: http://LocalHost:8080/login2?janrain_nonce=2008-08-24T14%3A51%3A22ZCfHIT2
openid.response_nonce: 2008-08-24T15:03:41ZZOY5bq
openid.assoc_handle: 1219590221:STLS.hI1O98zWAreZst5GU9N1:e5cb63bf40
openid.ns.sreg: http://openid.net/extensions/sreg/1.1
Status: 500 Internal Server Error
Cache-Control: no-cache
Content-Type: text/plain
Content-Length: 390

Traceback (most recent call last):
  File "C:\****\****\google_appengine\google\appengine\ext\webapp\__init__.py", line 499, in __call__
    handler.get(*groups)
  File "C:\****\****\google_appengine\demos\****\****.py", line 119, in get
    print '%s: %s' % (k,v)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-24: ordinal not in range(128)

というエラーになってしまう。文字コードがナンチャラカンチャラ。。。
Status: 500 Internal Server Errorってのも少し気になるけれども
無視してGoogleAppEngineにアップロードしてテスト。

Traceback (most recent call last):
  File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 499, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/*****/***/***.py", line 21, in get
    request = consumer.begin('https://mixi.jp')
  File "/base/data/home/apps/*****/***/openid/consumer/consumer.py", line 352, in begin
    'No usable OpenID services found for %s' % (user_url,), None)
DiscoveryFailure: No usable OpenID services found for https://mixi.jp

んんんん。うまく動かない。。。
また来週のやすみにいろいろイジってみよう。