Module: Veeam::Authentication

Included in:
API
Defined in:
lib/veeam/authentication.rb

Overview

Deals with authentication flow and stores it within global configuration

Instance Method Summary collapse

Instance Method Details

#login(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/veeam/authentication.rb', line 9

def (options = {})
  raise ConfigurationError, "Accesstoken/api-key not set" unless access_token
  # only bearer token needed 
  # will do sanitty check if token if valid
  get("/api/v3/about")
rescue Faraday::UnauthorizedError  => e

  raise AuthenticationError.new 'Unauthorized; response ' + e.to_s
end