Class: Qualys::Auth

Inherits:
Base
  • Object
show all
Defined in:
lib/qualys_api/auth.rb

Constant Summary

Constants inherited from Base

Base::PLATFORMS

Instance Method Summary collapse

Methods inherited from Base

#get, #post

Constructor Details

#initialize(username, password, server = :na) ⇒ Auth



3
4
5
6
7
8
# File 'lib/qualys_api/auth.rb', line 3

def initialize(username, password, server=:na)
  super(username, password, server)

  @username = username
  @password = password
end

Instance Method Details

#loginObject



10
11
12
13
14
15
16
17
# File 'lib/qualys_api/auth.rb', line 10

def 
  params = { action: 'login', username: @username, password: @password }
  response = post('/api/2.0/fo/session/', params )

  Qualys::Config.session_key = response.headers['set-cookie']

  true
end