Module: OpenIdAuthentication

Included in:
Sessions
Defined in:
lib/_open_id_authentication.rb

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Class Method Details

.new(app) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/_open_id_authentication.rb', line 6

def self.new(app)
  store = OpenIdAuthentication.store
  if store.nil?
    rad.logger.warn "OpenIdAuthentication.store is nil. Using in-memory store."
  end

  ::Rack::OpenID.new(app, OpenIdAuthentication.store)
end

.storeObject



15
16
17
# File 'lib/_open_id_authentication.rb', line 15

def self.store
  @@store
end

.store=(*store_option) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/_open_id_authentication.rb', line 19

def self.store=(*store_option)
  store, *parameters = *([ store_option ].flatten)

  @@store = case store
  when :memory
    require 'openid/store/memory'
    OpenID::Store::Memory.new
  when :file
    require 'openid/store/filesystem'
    OpenID::Store::Filesystem.new("#{rad.runtime_path}/tmp/openids")
  when :memcache
    require 'memcache'
    require 'openid/store/memcache'
    OpenID::Store::Memcache.new(MemCache.new(parameters))
  else
    raise "Unknown store!"
  end
end