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
-
#login(options = {}) ⇒ Object
helpcenter.veeam.com/docs/vac/rest/reference/vspc-rest.html?ver=80#tag/Authentication Authorize to the Veeam portal and return access_token.
Instance Method Details
#login(options = {}) ⇒ Object
helpcenter.veeam.com/docs/vac/rest/reference/vspc-rest.html?ver=80#tag/Authentication Authorize to the Veeam portal and return access_token
9 10 11 12 13 14 15 16 17 |
# File 'lib/veeam/authentication.rb', line 9 def login( = {}) 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 |