Class: Qualys::Auth
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(username, password, server = :na) ⇒ Auth
constructor
A new instance of Auth.
- #login ⇒ Object
Methods inherited from Base
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
#login ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/qualys_api/auth.rb', line 10 def login 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 |