Sinatraを使ってRack::Auth::OpenID等を使う場合、
shotgunを使って開発をしていると、check_authentication関係のエラーが出てくる事があるようです。
rackupを利用すれば問題は起きないのですが、Sessionがらみの問題でしょうか。shotgunが無いとリロードが結構面倒なので、はやく回避策が見つかると良いです。
See Also
Sinatraを使ってRack::Auth::OpenID等を使う場合、
shotgunを使って開発をしていると、check_authentication関係のエラーが出てくる事があるようです。
rackupを利用すれば問題は起きないのですが、Sessionがらみの問題でしょうか。shotgunが無いとリロードが結構面倒なので、はやく回避策が見つかると良いです。
See Also
Rails-2.3からRackに対応した事と関連が深いと思うのですが、
ruby-openidを使っていると、logger関係のエラーが出るようです。
ruby-openidでは、デフォルトでは以下のように
ruby>>
@@logger = Logger.new(STDERR)
<<--
STDERRを使うようになっているのですが、これがRackと相性が悪いようです。
以下のように、config/initializers/*.rbあたりで別途loggerを設定すると良いようです。
ruby>>
OpenID::Util::logger = Logger.new(File.join(Rails.root, %w(log openid.log)))
<<--
勉強会参加者の皆様、昨日はお疲れ様でした。
今回は、事前に参加登録していただいた方々がほとんど全員お越しくださったようで、配布資料も3度増刷がかかる盛況ぶりでした。内容のほうも昨年のComet勉強会を彷彿とさせるような非常に濃い話が飛び交い、想定していた以上に勉強ができる会になりました。ありがとうございます。
全体的な振り返りとしては、大体以下のような次第でした。
非常に密度の濃い議論や意見交換ができたと思います。
内容の濃さという意味では、昨年のComet勉強会を髣髴とさせるものがありましたね。勉強会後の満足感は、参加者によるところが大きく、最高の参加者が集まった時点で今回の勉強会の成功は決まっていたといって過言ではないと思います。
ありがとうございました。
最後になりましたが、会場提供をしていただいたドリコム様、ありがとうございました。
See Also
サーバ移行中で自動トラックバックがオフになってるのを忘れていました。Googleで探して見つけ次第手動で追加しています。
安藤さん
とドリコムのご好意により、下記日程でOpenID勉強会を開催する運びとなりました。
内容(仮)
参加をご希望のかたは、この記事にコメントしていただくか、Twitterで
@takiuchi
にご一報ください。
それでは、よろしくお願いいたします。
See Also
Insecure OPs easily bring problems to consumers trusting them.
I think that there should be a kind of world wide reliability evaluation system for OPs.
Suppose every OPs has its score on the list of OPs and they should make an effort to keep its score high.
RPs are able to exploit it to know which OP is trustworthy.
But obviously, the list is centralized.
This is the SPoF and is a quite big drawback.
It should be kept decentralized as well as OpenID itself.
EdgeRailsのOpenIdAuthenticationがruby-openid 2.0に対応した模様です。
Changeset [9103]: Updated OpenIdAuthentication to use Ruby OpenID 2.x.x gem (closes #10604)
Updated OpenIdAuthentication to use Ruby OpenID 2.x.x gem (closes #10604) [Josh Peek]
徐々に整備されてきましたね。
See Also
These days, I have been thinking about OpenID.
It is able to gather privacy informations at one place and they would be maintained easily.
On the other hand, thus it may become easy to cause a security crisis.
In order to find the solution, I have thought for a while.
I think that the secret sharing scheme (SSS) could be useful for solving this problem.
In other words, it could be reasonable way for achieving convenience and security to share the encrypted privacy informations between several OIPs by using SSS.
But I have no idea to make it run on the current OpenID spec. Hmm.
しばらく前からOpenIDについていろいろ調べているのですが、
個人情報が一箇所に集中することで、便利になる反面、
セキュリティ上のリスクが高まるという指摘があります。
確かにその通りで、対策を考えていたのですが、
マスターキーを秘密分散方式で複数作るのが、妥当な解決策かもしれないと思いました。
2つ鍵穴があるドアのイメージですね。
どちらか一方を奪われても安全なわけです。
セキュリティ強度の必要に応じて3つ、4つと増やしても良いですね。
現状のOpenIDの仕様の上でうまいこと運用できないかなあ。
See Also
I am worrying about the future of our natural right on the Internet.
Here right I say is for us to be human obviously.
In a word, it is becoming harder and harder for computers to distinguish human and bot.
Our activities on the Internet is too simple to recognize ourselves as human beings.
There are only click, click, click many clicks and sometimes typings.
Needless to say about clicks, nowadays, even typings are easy to be imitated by using algorithms of a sort of Markov-chain.
I think that this problem is worth discussing more.
If we lose this identity war, most of internet companies will lose their values brought by advertisements.
I guess that the identity provider such as OpenID Providers becomes very important role in near future.
They will become providing not only an identity but human proofs.
まだ完全ではないですが、いくつかの点でOpenID認証の挙動を改善しました。
ある程度まとまった時点で、Open ID Authentication用の
Railsプラグインを更新します。
不具合などに遭遇いたしましたら、ご連絡いただければ
プラグインの改善に役立てさせていただきます。
よろしくお願いいたします。
In this weblog system, "nickname" and "email" required to IdP.
This is from a behaviour of the original RestfulOpenIDAuthentication plugin.
(I think that it is expecting the myopenid.com as default IdP and it has them as mandatory parameters.)
If you are using other IdP, it might have neither "nicknames" nor "email". In that case, you need to fill the lacking parameters and to retry.
Obviously, that was a big barrier for users.
So I have changed this system so that can make IdPs free from required parameters and make a chance to add the lacking informations immediately.
I consider that every IdCs require such the mechanism due to the architecture of OpenID.
このBlogシステムでは、myopenid.comにあわせて、
IdPに対して "nickname" と "email" を必須パラメータとしていましたが、
IdPによってデフォルトで持っているパラメータが違うため、
場合によってはこれらのパラメータを別途入力してから、
再度トライしてもらう必要がありました。
これは非常に敷居が高いため、要求したデータが得られなかった場合、
足りない情報をその場で追加できるようにしました。
OpenIDの仕組み上、このような仕組みを用意することは
必要になってきそうですね。
以前のブログで大量のSpamコメントに困っていた経験から、
コメントを付ける機能をなくしていたのですが、
OpenID認証によってコメントを付けられるようにしました。
RestfulOpenIDAuthenticationプラグインに、まだ若干バグがあるようで、
一部のIdPでは正しく認証できない事があるようです。
その際は、Twitterで@takiuchiにご連絡いただければ、
プラグインの実装の改善に役立てさせていただきます。
よろしくお願いいたします。
At rev. 8929, I have found a good news for OpenID users.
http://svn.rubyonrails.org/rails/plugins/open_id_authentication/CHANGELOG
Tied plugin to ruby-openid 1.1.4 gem until we can make it compatible with 2.x [DHH]
Thanks DHH!
一時動かなくなっていた
restful_open_id_authenticationプラグイン
ですが、
ひとまず手元の環境で動く状態になったので、こちらに置いておきます。
http://svn.s21g.com/public/rails/plugins/restful_open_id_authentication_redux/
ruby-openid-2.0.1
のexamplesのコードが非常に参考になりました。
プラグイン中のmigrationジェネレータは、何も無い状態から
DBを作るためのマイグレーションになっています。
すでにrestful_open_id_authenticationプラグインを
使っている状態からアップグレードする場合は、下記
[2]に掲載したmigrationコードをご利用ください。
Enter at your own risk!
See Also
restful_open_id_authenticationプラグイン
でOpenIDストアに使用していたDBを
ruby-openid 2.0に移行させるためのマイグレーション。
ruby-openid 2.0のexamplesから抜粋。
rails>>
class UpgradeOpenIdStore < ActiveRecord::Migration
def self.up
drop_table "open_id_settings"
drop_table "open_id_nonces"
create_table "open_id_nonces", :force => true do |t|
t.column :server_url, :string, :null => false
t.column :timestamp, :integer, :null => false
t.column :salt, :string, :null => false
end
end
def self.down
drop_table "open_id_nonces"
create_table "open_id_nonces", :force => true do |t|
t.column "nonce", :string
t.column "created", :integer
end
create_table "open_id_settings", :force => true do |t|
t.column "setting", :string
t.column "value", :binary
end
end
end
<<--
ちなみにオリジナルのプラグインが生成したマイグレーションコードはこちら。
rails>>
create_table :open_id_associations, :force => true do |t|
t.column :server_url, :binary
t.column :handle, :string
t.column :secret, :binary
t.column :issued, :integer
t.column :lifetime, :integer
t.column :assoc_type, :string
end
create_table :open_id_nonces, :force => true do |t|
t.column :nonce, :string
t.column :created, :integer
end
create_table :open_id_settings, :force => true do |t|
t.column :setting, :string
t.column :value, :binary
end
<<--
open_id_settingsは不要になって、open_id_nouncesの
内容が変わります。
昨日RubyGemsを1.0.0にアップデートしたところ、require_gemが使えなくなってしまったため、
内部でrequire_gemを使っているGemが使えなくなりました。
かなり前から移行措置が取られていたため、
使えなくなったGemはほとんど無かったのですが、
一個だけ、ruby-openidの1.x.x系列が使えなくなっていました。
その結果、愛用していた
restful_open_id_authenticationプラグインが
動かなくなってしまいました。
結構いろんなプロダクトで使っていたので影響大です。
ruby-openidの2.x.x系列は、require_gemを使わないようなコードに
なっているのですが、インターフェイスが大分変わっているため、
すんなりとアップグレードが出来ない感じですね。
しかし、アップグレードしないわけにもいかないので、
restful_open_id_authenticationプラグインの
ruby-openid 2.x.x系対応に着手します。
すでに同じ問題に取り組んでいる方がいらっしゃいましたら、
喜んでご協力いたしますのでご連絡いただけるとありがたいです。
連絡先