Changeset 6514
- Timestamp:
- 04/11/07 19:58:30 (1 year ago)
- Files:
-
- plugins/open_id_authentication/CHANGELOG (modified) (1 diff)
- plugins/open_id_authentication/init.rb (deleted)
- plugins/open_id_authentication/lib/generators (added)
- plugins/open_id_authentication/lib/generators/open_id_authentication_tables (added)
- plugins/open_id_authentication/lib/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb (added)
- plugins/open_id_authentication/lib/generators/open_id_authentication_tables/templates (added)
- plugins/open_id_authentication/lib/generators/open_id_authentication_tables/templates/migration.rb (added)
- plugins/open_id_authentication/lib/open_id_authentication (added)
- plugins/open_id_authentication/lib/open_id_authentication.rb (modified) (2 diffs)
- plugins/open_id_authentication/lib/open_id_authentication/association.rb (added)
- plugins/open_id_authentication/lib/open_id_authentication/db_store.rb (added)
- plugins/open_id_authentication/lib/open_id_authentication/nonce.rb (added)
- plugins/open_id_authentication/lib/open_id_authentication/setting.rb (added)
- plugins/open_id_authentication/README (modified) (1 diff)
- plugins/open_id_authentication/tasks/open_id_authentication_tasks.rake (modified) (1 diff)
- plugins/open_id_authentication/uninstall.rb (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/open_id_authentication/CHANGELOG
r6331 r6514 1 * Added a new default database-backed store after experiencing trouble with the filestore on NFS. The file store is still available as an option [DHH] 2 1 3 * Added normalize_url and applied it to all operations going through the plugin [DHH] 2 4 plugins/open_id_authentication/lib/open_id_authentication.rb
r6452 r6514 1 1 module OpenIdAuthentication 2 2 OPEN_ID_AUTHENTICATION_DIR = RAILS_ROOT + "/tmp/openids" 3 4 @@store = :db 5 mattr_accessor :store 3 6 4 7 class Result … … 107 110 108 111 def open_id_consumer 109 OpenID::Consumer.new(session, OpenID::FilesystemStore.new(OPEN_ID_AUTHENTICATION_DIR)) 112 OpenID::Consumer.new(session, open_id_store) 113 end 114 115 def open_id_store 116 case store 117 when :db : OpenIdAuthentication::DbStore.new 118 when :file: OpenID::FilesystemStore.new(OPEN_ID_AUTHENTICATION_DIR) 119 else 120 raise "Unknown store: #{store}" 121 end 110 122 end 111 123 plugins/open_id_authentication/README
r6331 r6514 15 15 ============= 16 16 17 OpenID authentication uses the session, so be sure that you haven't turned that off. It also relies on tmp/openids 18 being present in RAILS_ROOT. The install.rb should install that automatically as you get the plugin, but if not, be 19 sure to do that yourself. 17 OpenID authentication uses the session, so be sure that you haven't turned that off. It also relies on a number of 18 database tables to store the authentication keys. So you'll have to run the migration to create these before you get started: 19 20 rake open_id_authentication:db:create 21 22 Alternatively, you can use the file-based store, which just relies on on tmp/openids being present in RAILS_ROOT. But be aware that this store only works if you have a single application server. And it's not safe to use across NFS. It's recommended that you use the database store if at all possible. To use the file-based store, you'll also have to add this line to your config/environment.rb: 23 24 OpenIdAuthentication.store = :file 20 25 21 26 This particular plugin also relies on the fact that the authentication action allows for both POST and GET operations. plugins/open_id_authentication/tasks/open_id_authentication_tasks.rake
r6245 r6514 1 # desc "Explaining what the task does" 2 # task :open_id_authentication do 3 # # Task goes here 4 # end 1 namespace :open_id_authentication do 2 namespace :db do 3 desc "Creates authentication tables for use with OpenIdAuthentication" 4 task :create => :environment do 5 raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations? 6 require 'rails_generator' 7 require 'rails_generator/scripts/generate' 8 Rails::Generator::Scripts::Generate.new.run([ "open_id_authentication_tables", "open_id_authentication_tables" ]) 9 end 10 11 desc "Clear the authentication tables" 12 task :clear => :environment do 13 OpenIdAuthentication::DbStore.gc 14 end 15 end 16 end