Class: OmniAuth::Strategies::Keystone

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



18
19
20
# File 'lib/omniauth-keystone.rb', line 18

def auth_token
  @auth_token
end

Instance Method Details

#callback_phaseObject



30
31
32
33
34
35
36
37
# File 'lib/omniauth-keystone.rb', line 30

def callback_phase
  os = OpenStack::Connection.create({:username => request['username'],
                                     :api_key=>request['password'],
                                     :auth_method=>"password",
                                     :auth_url => auth_url,
                                     :authtenant_name => request['username']})
  super
end

#request_phaseObject



20
21
22
23
24
25
26
27
28
# File 'lib/omniauth-keystone.rb', line 20

def request_phase
  OmniAuth::Form.build(
    :title => (options[:title] || "Authenticate"), 
    :url => callback_path
  ) do |field|
    field.text_field 'Username', 'username'
    field.password_field 'Password', 'password'
  end.to_response
end