Module: SparkApi::Authentication::OAuth2Impl

Defined in:
lib/spark_api/authentication/oauth2_impl/grant_type_refresh.rb,
lib/spark_api/authentication/oauth2.rb,
lib/spark_api/authentication/oauth2_impl/cli_provider.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_base.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_code.rb,
lib/spark_api/authentication/oauth2_impl/faraday_middleware.rb,
lib/spark_api/authentication/oauth2_impl/grant_type_password.rb

Overview

OAuth2 authentication flow to refresh an access token

Defined Under Namespace

Classes: CLIProvider, FaradayMiddleware, GrantTypeBase, GrantTypeCode, GrantTypePassword, GrantTypeRefresh, SparkbarFaradayMiddleware

Class Method Summary collapse

Class Method Details

.load_provider(string, args = {}) ⇒ Object

Loads a provider class from a string



264
265
266
267
268
269
270
# File 'lib/spark_api/authentication/oauth2.rb', line 264

def self.load_provider(string, args={})
  constant = Object
  string.split("::").compact.each { |name| constant = constant.const_get(name) unless name == ""}
  constant.new(args)
rescue => e
  raise ArgumentError, "The value '#{string}' is an invalid class name for an oauth2 provider:  #{e.message}"
end