「masquerade」を使用し、OpenIDサーバ(OP)を立ててみます。
【参考URL】
https://github.com/dbloete/masquerade/wiki
①以下のサイトから、dbloete-masquerade-fdf8ef1.zipファイルをダウンロードし、任意の場所に格納します。
https://github.com/dbloete/masquerade/
②configフォルダ直下にあるdatabase.yml.exampleをdatabase.ymlに変名します。また、database.ymlに使用するDB情報(MySQLを使用)を設定します。
※予め、MySQLにopeniddbというデータベースを作成する必要があります。
development:
adapter: mysql2
host: localhost
database: openiddb
username: root
password: password
encoding: utf8
test:
adapter: mysql2
host: localhost
database: openiddb
username: root
password: password
encoding: utf8
production:
adapter: mysql2
host: localhost
database: openiddb
username: root
password: password
encoding: utf8
③configフォルダ直下にあるapp_config.yml.exampleをapp_config.ymlに変名します。また、実行環境に合わせて修正します。
④DBマイグレートを実行します。rakeコマンドを実行します。
C:\Users\yasu\Downloads\dbloete-masquerade-fdf8ef1>rake db:migrate
rake aborted!
126: 指定されたモジュールが見つかりません。 - C:/Ruby193/lib/ruby/gems/1.9.1/gem
s/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so
(See full trace by running task with --trace)
LIBMYSQL.dllが見つからない旨のエラーが発生しました。「http://exposed.egoism.jp/wordpress/?p=295」を参照し、libmysql.dllをRubyのbinフォルダおよびlibフォルダにコピーします。
再度、rakeコマンドを実行します。
C:\Users\yasu\Downloads\dbloete-masquerade-fdf8ef1>rake db:migrate
== CreateInitialSchema: migrating ============================================
-- create_table(:accounts, {:force=>true})
-> 0.3100s
-- add_index(:accounts, :login, {:unique=>true})
-> 0.3720s
-- add_index(:accounts, :email, {:unique=>true})
-> 0.3320s
-- create_table(:personas)
-> 0.1510s
-- add_index(:personas, [:account_id, :title], {:unique=>true})
-> 0.3730s
-- create_table(:sites)
-> 0.1940s
-- add_index(:sites, [:account_id, :url], {:unique=>true})
-> 0.3530s
-- create_table(:release_policies)
-> 0.3090s
-- add_index(:release_policies, [:site_id, :property], {:unique=>true})
-> 1.0720s
-- create_table(:open_id_associations, {:force=>true})
-> 0.9300s
-- create_table(:open_id_nonces, {:force=>true})
-> 0.1610s
-- create_table(:open_id_requests, {:force=>true})
-> 0.2960s
-- add_index(:open_id_requests, :token, {:unique=>true})
-> 0.3280s
-- create_table(:countries, {:force=>true})
-> 0.2060s
-- add_index(:countries, :code, {:unique=>true})
-> 0.3380s
-- create_table(:languages)
-> 0.2480s
== CreateInitialSchema: migrated (5.9880s) ===================================
== AddTypeIdentifierToReleasePolicies: migrating =============================
-- add_column(:release_policies, :type_identifier, :string)
-> 0.4710s
-- remove_index(:release_policies, {:column=>[:site_id, :property]})
-> 0.3910s
-- add_index(:release_policies, [:site_id, :property, :type_identifier], {:uniqu
e=>true, :name=>"unique_property"})
-> 0.3740s
== AddTypeIdentifierToReleasePolicies: migrated (1.4610s) ====================
== AddAxPropertiesToPersona: migrating =======================================
-- add_column(:personas, :address, :string)
-> 0.4380s
-- add_column(:personas, :address_additional, :string)
-> 0.4590s
-- add_column(:personas, :city, :string)
-> 0.4240s
-- add_column(:personas, :state, :string)
-> 1.4440s
-- add_column(:personas, :company_name, :string)
-> 2.6610s
-- add_column(:personas, :job_title, :string)
-> 0.7400s
-- add_column(:personas, :address_business, :string)
-> 0.4900s
-- add_column(:personas, :address_additional_business, :string)
-> 0.5840s
-- add_column(:personas, :postcode_business, :string)
-> 0.5400s
-- add_column(:personas, :city_business, :string)
-> 0.5170s
-- add_column(:personas, :state_business, :string)
-> 0.7380s
-- add_column(:personas, :country_business, :string)
-> 1.4160s
-- add_column(:personas, :phone_home, :string)
-> 0.4050s
-- add_column(:personas, :phone_mobile, :string)
-> 0.6170s
-- add_column(:personas, :phone_work, :string)
-> 0.5300s
-- add_column(:personas, :phone_fax, :string)
-> 0.5850s
-- add_column(:personas, :im_aim, :string)
-> 0.6920s
-- add_column(:personas, :im_icq, :string)
-> 0.5820s
-- add_column(:personas, :im_msn, :string)
-> 0.3670s
-- add_column(:personas, :im_yahoo, :string)
-> 0.5900s
-- add_column(:personas, :im_jabber, :string)
-> 0.3650s
-- add_column(:personas, :im_skype, :string)
-> 0.4500s
-- add_column(:personas, :image_default, :string)
-> 1.9550s
-- add_column(:personas, :biography, :string)
-> 1.9280s
-- add_column(:personas, :web_default, :string)
-> 1.3610s
-- add_column(:personas, :web_blog, :string)
-> 0.6520s
== AddAxPropertiesToPersona: migrated (21.5550s) =============================
== AddYubicoIdentityToAccount: migrating =====================================
-- add_column(:accounts, :yubico_identity, :string, {:limit=>12})
-> 0.5360s
== AddYubicoIdentityToAccount: migrated (0.5370s) ============================
== AddPublicPersona: migrating ===============================================
-- add_column(:accounts, :public_persona_id, :integer)
-> 0.3990s
== AddPublicPersona: migrated (0.4010s) ======================================
== AddAuthenticationAttributesToAccount: migrating ===========================
-- add_column(:accounts, :last_authenticated_at, :datetime)
-> 0.6540s
-- add_column(:accounts, :last_authenticated_with_yubikey, :boolean)
-> 0.4520s
== AddAuthenticationAttributesToAccount: migrated (1.1090s) ==================
== SplitDob: migrating =======================================================
-- add_column(:personas, :dob_day, :integer, {:limit=>2})
-> 0.7480s
-- add_column(:personas, :dob_month, :integer, {:limit=>2})
-> 0.5800s
-- add_column(:personas, :dob_year, :integer, {:limit=>4})
-> 0.4610s
-- remove_column(:personas, :dob)
-> 0.8010s
== SplitDob: migrated (2.6080s) ==============================================
⑤ポート3001でサーバを起動します。
C:\Users\yasu\Downloads\dbloete-masquerade-fdf8ef1>rails server -p 3001
=> Booting WEBrick
=> Rails 3.0.10 application starting in development on http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-11-20 14:32:01] INFO WEBrick 1.3.1
[2011-11-20 14:32:01] INFO ruby 1.9.3 (2011-10-30) [i386-mingw32]
[2011-11-20 14:32:01] INFO WEBrick::HTTPServer#start: pid=6884 port=3001
⑥「http://localhost:3001/」にアクセスし、以下の画面が表示されることを確認します。
0 件のコメント:
コメントを投稿