Class: OmniAuth::Strategies::LDAP

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/ldap.rb,
lib/omniauth/strategies/ldap/adaptor.rb

Defined Under Namespace

Classes: Adaptor

Constant Summary collapse

@@config =
{
  'name' => 'cn',
  'first_name' => 'givenName',
  'last_name' => 'sn',
  'email' => ['mail', "email", 'userPrincipalName'],
  'phone' => ['telephoneNumber', 'homePhone', 'facsimileTelephoneNumber'],
  'mobile_number' => ['mobile', 'mobileTelephoneNumber'],
  'nickname' => ['uid', 'userid', 'sAMAccountName'],
  'title' => 'title',
  'location' => {"%0, %1, %2, %3 %4" => [['address', 'postalAddress', 'homePostalAddress', 'street', 'streetAddress'], ['l'], ['st'],['co'],['postOfficeBox']]},
  'uid' => 'dn',
  'url' => ['wwwhomepage'],
  'image' => 'jpegPhoto',
  'description' => 'description'
}

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, &block) ⇒ LDAP

Initialize the LDAP Middleware

Parameters:

  • app (Rack Application)

    Standard Rack middleware argument.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :title (String, 'LDAP Authentication')

    A title for the authentication form.



32
33
34
35
36
# File 'lib/omniauth/strategies/ldap.rb', line 32

def initialize(app, options = {}, &block)
  super(app, options[:name] || :ldap, options.dup, &block)
  @name_proc = (@options.delete(:name_proc) || Proc.new {|name| name})
  @adaptor = OmniAuth::Strategies::LDAP::Adaptor.new(options)
end