Browse Source

Merge pull request #151 from ilyaglow/copy-requests-session

Inherit OpenID request headers and cookies to interact with Admin endpoints
pull/265/head
Marcos Pereira 3 years ago
committed by GitHub
parent
commit
4b7b5cd115
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      keycloak/keycloak_admin.py

7
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
@ -1736,10 +1737,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')

Loading…
Cancel
Save