Method: Auth0::Mixins::Initializer#authorization_header_basic

Defined in:
lib/auth0/mixins/initializer.rb

#authorization_header_basic(options) ⇒ Object

[View source] [View on GitHub]

37
38
39
40
41
42
# File 'lib/auth0/mixins/initializer.rb', line 37

def authorization_header_basic(options)
  connection_id = options.fetch(:connection_id, Auth0::Api::AuthenticationEndpoints::UP_AUTH)
  user = options.fetch(:user, nil)
  password = options.fetch(:password, nil)
  add_headers('Authorization' => "Basic #{Base64.strict_encode64("#{connection_id}\\#{user}:#{password}")}")
end