Class: Bandwidth::MessagingBasicAuth
- Inherits:
-
Object
- Object
- Bandwidth::MessagingBasicAuth
- Defined in:
- lib/bandwidth/http/auth/messaging_basic_auth.rb
Overview
Utility class for basic authorization.
Class Method Summary collapse
-
.apply(config, http_request) ⇒ Object
Add basic authentication to the request.
Class Method Details
.apply(config, http_request) ⇒ Object
Add basic authentication to the request. be added.
14 15 16 17 18 19 20 |
# File 'lib/bandwidth/http/auth/messaging_basic_auth.rb', line 14 def self.apply(config, http_request) username = config.messaging_basic_auth_user_name password = config.messaging_basic_auth_password value = Base64.strict_encode64("#{username}:#{password}") header_value = "Basic #{value}" http_request.headers['Authorization'] = header_value end |