Class: Fog::Credentials::AzureRM

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/azurerm/credentials.rb

Overview

This class is managing credentials token

Class Method Summary collapse

Class Method Details

.get_credentials(tenant_id, client_id, client_secret, environment = ENVIRONMENT_AZURE_CLOUD) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/azurerm/credentials.rb', line 5

def self.get_credentials(tenant_id, client_id, client_secret, environment = ENVIRONMENT_AZURE_CLOUD)
  if @credentials.nil? || new_management_credential?(tenant_id, client_id, client_secret, environment)
    get_new_credentials(tenant_id, client_id, client_secret, environment)
  else
    @credentials
  end
end

.get_token(tenant_id, client_id, client_secret, environment = ENVIRONMENT_AZURE_CLOUD) ⇒ Object



13
14
15
16
# File 'lib/fog/azurerm/credentials.rb', line 13

def self.get_token(tenant_id, client_id, client_secret, environment = ENVIRONMENT_AZURE_CLOUD)
  get_credentials(tenant_id, client_id, client_secret, environment) if @credentials.nil?
  @token_provider.get_authentication_header
end