force_basic_auth for default httpapi connection auth (#59193)
The default for a httpapi connection is to do basic auth, however when setting the url_username and url_password without force_basic_auth, the call to ansible.module_utils.open_url would not always properly handle the basic auth headers based on the combinations of **kwargs passed. This ensures that is always the case when no session token exists and as the goal is to use basic auth in the event of not having a session token, this should be a safe operation. Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
parent
3a103405b1
commit
49da47d09f
1 changed files with 1 additions and 0 deletions
|
@ -265,6 +265,7 @@ class Connection(NetworkConnectionBase):
|
|||
headers.update(self._auth)
|
||||
url_kwargs['headers'] = headers
|
||||
else:
|
||||
url_kwargs['force_basic_auth'] = True
|
||||
url_kwargs['url_username'] = self.get_option('remote_user')
|
||||
url_kwargs['url_password'] = self.get_option('password')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue