Module: LeveretAuth

Defined in:
lib/leveret_auth.rb,
lib/leveret_auth/utils.rb,
lib/leveret_auth/config.rb,
lib/leveret_auth/engine.rb,
lib/leveret_auth/errors.rb,
lib/leveret_auth/ldap/connection.rb,
lib/leveret_auth/orm/active_record.rb,
lib/leveret_auth/ldap/configuration.rb,
lib/leveret_auth/strategies/base_strategy.rb,
lib/leveret_auth/strategies/ldap_strategy.rb,
lib/leveret_auth/strategies/devise_strategy.rb,
lib/leveret_auth/orm/active_record/identities.rb,
lib/generators/leveret_auth/migration_generator.rb

Overview

require ‘leveret_auth/orm/active_record/mixins/identities’

Defined Under Namespace

Modules: Errors, Ldap, Orm, Strategies, Utils Classes: Config, Engine, Identities, MigrationGenerator, MissingConfiguration

Class Method Summary collapse

Class Method Details

.auth_with_doorkeeper(params) ⇒ Object



22
23
24
25
26
# File 'lib/leveret_auth.rb', line 22

def auth_with_doorkeeper(params)
  strategy_class = find_strategy(params[:grant_type], provider: params[:provider])
  strategy = strategy_class.new(params)
  strategy.authenticate!
end

.configurationObject



16
17
18
# File 'lib/leveret_auth/config.rb', line 16

def configuration
  @configuration || (raise MissingConfiguration)
end

.configure(&block) ⇒ Object



20
21
22
# File 'lib/leveret_auth/config.rb', line 20

def configure(&block)
  @configuration = Config::Builder.new(&block).build
end

.setupObject



11
12
13
14
# File 'lib/leveret_auth/config.rb', line 11

def setup
  run_orm_hooks
  add_extension_to_devise
end