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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
4 deletions
-
keycloak/keycloak_admin.py
|
@ -26,6 +26,7 @@ |
|
|
|
|
|
|
|
|
import json |
|
|
import json |
|
|
from builtins import isinstance |
|
|
from builtins import isinstance |
|
|
|
|
|
from copy import deepcopy |
|
|
from typing import Iterable |
|
|
from typing import Iterable |
|
|
|
|
|
|
|
|
from .connection import ConnectionManager |
|
|
from .connection import ConnectionManager |
|
@ -1736,10 +1737,8 @@ class KeycloakAdmin: |
|
|
# merge custom headers to main headers |
|
|
# merge custom headers to main headers |
|
|
headers.update(self.custom_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): |
|
|
def refresh_token(self): |
|
|
refresh_token = self.token.get('refresh_token') |
|
|
refresh_token = self.token.get('refresh_token') |
|
|