Module: AuthlogicCrowdRest::Session::Config

Defined in:
lib/authlogic_crowd_rest/session.rb

Instance Method Summary collapse

Instance Method Details

#crowd_application_name(value = nil) ⇒ Object Also known as: crowd_application_name=

The name in crowd for your application

  • Default: nil
  • Accepts: String


25
26
27
# File 'lib/authlogic_crowd_rest/session.rb', line 25

def crowd_application_name(value = nil)
  rw_config(:crowd_application_name, value)
end

#crowd_application_password(value = nil) ⇒ Object Also known as: crowd_application_password=

The password in crowd for your application

  • Default: nil
  • Accepts: String


34
35
36
# File 'lib/authlogic_crowd_rest/session.rb', line 34

def crowd_application_password(value = nil)
  rw_config(:crowd_application_password, value)
end

#crowd_base_url(value = nil) ⇒ Object Also known as: crowd_base_url=

The URL of your crowd rest API. Should be something like https://localhost:8095/crowd/rest

  • Default: nil
  • Accepts: String


16
17
18
# File 'lib/authlogic_crowd_rest/session.rb', line 16

def crowd_base_url(value = nil)
  rw_config(:crowd_base_url, value)
end

#find_by_crowd_login_method(value = nil) ⇒ Object Also known as: find_by_crowd_login_method=

Once Crowd authentication has succeeded we need to find the user in the database. By default this just calls the find_by_crowd_login method provided by ActiveRecord. If you have a more advanced set up and need to find users differently specify your own method and define your logic in there.

For example, if you allow users to store multiple crowd logins with their account, you might do something like:

class User < ActiveRecord::Base
def self.()
  first(:conditions => ["#{CrowdLogin.table_name}.login = ?", ], :join => :crowd_logins)
end
end
  • Default: :find_by_crowd_login
  • Accepts: Symbol


53
54
55
# File 'lib/authlogic_crowd_rest/session.rb', line 53

def (value = nil)
  rw_config(:find_by_crowd_login_method, value, :find_by_crowd_login)
end