diff --git a/infoblox_client/connector.py b/infoblox_client/connector.py index a54e3d2..dccf6d2 100644 --- a/infoblox_client/connector.py +++ b/infoblox_client/connector.py @@ -20,6 +20,7 @@ import six import urllib3 import time +import base64 from requests import exceptions as req_exc try: @@ -196,8 +197,9 @@ def _configure_session(self): self.session.mount('http://', adapter) self.session.mount('https://', adapter) if hasattr(self, 'username') and hasattr(self, 'password'): - LOG.info("Authenticating with username and password.") - self.session.auth = (self.username, self.password) + auth_str = f"{self.username}:{self.password}" + encoded_auth = base64.b64encode(auth_str.encode('utf-8')).decode('utf-8') + self.session.headers.update({'Authorization': f'Basic {encoded_auth}'}) else: self.session.cert = (self.cert, self.key) LOG.info("Authenticating with client certificate.")