Sha256: a6f4ca2cbf31af56e008a6fc7e952041181639adfb080d3ca6bc9495cd5a0a0b

Contents?: true

Size: 713 Bytes

Versions: 20

Compression:

Stored size: 713 Bytes

Contents

# bandwidth
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).

require 'base64'

module Bandwidth
  # Utility class for basic authorization.
  class TwoFactorAuthBasicAuth
    # Add basic authentication to the request.
    # @param [HttpRequest] The HttpRequest object to which authentication will
    # be added.
    def self.apply(config, http_request)
      username = config.two_factor_auth_basic_auth_user_name
      password = config.two_factor_auth_basic_auth_password
      value = Base64.strict_encode64("#{username}:#{password}")
      header_value = "Basic #{value}"
      http_request.headers['Authorization'] = header_value
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bandwidth-sdk-6.2.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-6.1.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-6.0.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-5.0.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-4.0.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.13.2 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.13.1 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.13.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.12.1 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.12.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.11.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.10.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.9.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.8.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.7.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.6.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.5.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.4.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.3.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
bandwidth-sdk-3.2.0 lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb