Class: Azure::Auth::TokenProvider::AzureCliTokenSource

Inherits:
Object
  • Object
show all
Defined in:
lib/azure/auth/token_provider/azure_cli_token_source.rb

Overview

A token source that gets token using cli tool az

Constant Summary collapse

DEFAULT_AZ_PATH =
'/usr/bin:/usr/local/bin'
BASH =
'/bin/bash'
AZ_GET_TOKEN =
'az account get-access-token -o json'

Instance Method Summary collapse

Instance Method Details

#token(resource) ⇒ AzureMSITokenProvider::Token

Returns an access token from cli tool az

Parameters:

  • resource (Stirng)

    Azure resource URI string.

Returns:

  • (AzureMSITokenProvider::Token)


45
46
47
48
49
50
51
# File 'lib/azure/auth/token_provider/azure_cli_token_source.rb', line 45

def token(resource)
  if Gem.win_platform?
    token_windows(resource)
  else
    token_nix(resource)
  end
end