Class: OmniAuth::Strategies::PAM
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::PAM
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/pam.rb
Instance Method Summary collapse
Instance Method Details
#callback_phase ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/omniauth/strategies/pam.rb', line 22 def callback_phase rpam_opts = Hash.new rpam_opts[:service] = [:service] unless [:service].nil? unless Rpam.auth(request['username'], request['password'], rpam_opts) return fail!(:invalid_credentials) end super end |
#parse_gecos ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/omniauth/strategies/pam.rb', line 33 def parse_gecos if [:gecos_map].kind_of?(Array) begin gecos = Etc.getpwnam(uid).gecos.split(',') Hash[[:gecos_map].zip(gecos)].delete_if { |k, v| v.nil? } rescue end end end |
#request_phase ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/omniauth/strategies/pam.rb', line 12 def request_phase OmniAuth::Form.build( :title => ([:title] || "Authenticate"), :url => callback_path ) do |field| field.text_field 'Username', 'username' field.password_field 'Password', 'password' end.to_response end |