Class: Armrest::Api::Auth::Login

Inherits:
Base
  • Object
show all
Defined in:
lib/armrest/api/auth/login.rb

Constant Summary

Constants inherited from Base

Base::HTTP_READ_METHODS, Base::HTTP_WRITE_METHODS, Base::MAX_RETRIES

Instance Method Summary collapse

Methods inherited from Base

#append_api_version, #build_request, #headers, #http, #initialize, #request, #send_request, #set_headers!, #standarize_path, #url, #with_open_timeout

Methods included from Settings

#client_id, #client_secret, #group, #location, #resource, #subscription_id, #tenant_id

Methods included from HandleResponse

#load_json, #ok?

Methods included from Logging

#default_logger, #logger, #logger=

Constructor Details

This class inherits a constructor from Armrest::Api::Base

Instance Method Details

#credsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/armrest/api/auth/login.rb', line 7

def creds
  url = "#{tenant_id}/oauth2/token"
  resp = get(url,
    grant_type: "client_credentials",
    client_id: client_id,
    client_secret: client_secret,
    resource: resource,
  )
  load_json(resp)
end

#endpointObject



3
4
5
# File 'lib/armrest/api/auth/login.rb', line 3

def endpoint
  "https://login.microsoftonline.com"
end