From fa9f1741af02012d70c0dab1830503b9c225e978 Mon Sep 17 00:00:00 2001 From: Ilya Glotov Date: Fri, 4 Dec 2020 14:09:28 +0300 Subject: [PATCH] Use the same request headers and cookies --- keycloak/keycloak_admin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index f88d00d..e5a55cb 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -26,6 +26,7 @@ import json from builtins import isinstance +from copy import deepcopy from typing import Iterable from .connection import ConnectionManager @@ -1737,10 +1738,8 @@ class KeycloakAdmin: # merge custom headers to main headers headers.update(self.custom_headers) - self._connection = ConnectionManager(base_url=self.server_url, - headers=headers, - timeout=60, - verify=self.verify) + self._connection = deepcopy(self.keycloak_openid.connection()) + self._connection._headers.update(headers) def refresh_token(self): refresh_token = self.token.get('refresh_token')