module Google::Auth
def get_application_default scope = nil, options = {}
-
(Google::Auth::InitializationError)- If the credentials cannot be found
Parameters:
-
options(Hash) -- Connection options. These may be used to configure -
scope(string|array|nil) -- the scope(s) to access
def get_application_default scope = nil, options = {} creds = DefaultCredentials.from_env(scope, options) || DefaultCredentials.from_well_known_path(scope, options) || DefaultCredentials.from_system_default_path(scope, options) return creds unless creds.nil? raise InitializationError, NOT_FOUND_ERROR unless GCECredentials.on_gce? options GCECredentials.new options.merge(scope: scope) end