Class: OmniAuth::Strategies::Aleph

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

Instance Method Summary collapse

Instance Method Details

#callback_phaseObject



36
37
38
39
40
41
42
43
# File 'lib/omniauth/strategies/aleph.rb', line 36

def callback_phase
  return fail!(:missing_credentials) if missing_credentials?
  adaptor = OmniAuth::Aleph::Adaptor.new(@options)
  @raw_info = adaptor.authenticate(username, password)
  super
rescue OmniAuth::Aleph::Adaptor::AlephError => e
  fail!(e.message)
end

#request_phaseObject



28
29
30
31
32
33
34
# File 'lib/omniauth/strategies/aleph.rb', line 28

def request_phase
  OmniAuth::Aleph::Adaptor.validate @options
  OmniAuth::Form.build(title: options[:title], url: callback_path) do |f|
    f.text_field 'Login', 'username'
    f.password_field 'Password', 'password'
  end.to_response
end