ads_common/lib/ads_common/api.rb
def create_auth_handler()
      auth_method = @config.read('authentication.method', :OAUTH2)
      return case auth_method
        when :OAUTH
          raise AdsCommon::Errors::Error,
              'OAuth authorization method is deprecated, use OAuth2 instead.'
        when :OAUTH2
          AdsCommon::Auth::OAuth2Handler.new(
              @config,
              api_config.config(:oauth_scope)
          )
        when :OAUTH2_SERVICE_ACCOUNT
          AdsCommon::Auth::OAuth2ServiceAccountHandler.new(
              @config,
              api_config.config(:oauth_scope)
          )
        else
          raise AdsCommon::Errors::Error,
              "Unknown authentication method '%s'" % auth_method
        end
    end
def create_auth_handler()
      auth_method = @config.read('authentication.method', :OAUTH2)
      return case auth_method
        when :OAUTH
          raise AdsCommon::Errors::Error,
              'OAuth authorization method is deprecated, use OAuth2 instead.'
        when :OAUTH2
          AdsCommon::Auth::OAuth2Handler.new(
              @config,
              api_config.config(:oauth_scope)
          )
        when :OAUTH2_SERVICE_ACCOUNT
          AdsCommon::Auth::OAuth2ServiceAccountHandler.new(
              @config,
              api_config.config(:oauth_scope)
          )
        else
          raise AdsCommon::Errors::Error,
              "Unknown authentication method '%s'" % auth_method
        end
    end
Auxiliary method to create an authentication handler.

 Returns:
 - auth handler