Hi this is my first contribution to this project, and I hope I'm doing this right. If there's anything I've missed or any additional information you need, please let me know.
Overview
Refactor of KeycloakOpenIDConnection, setting headers and custom_headers before any web request requiring any custom headers. This allows custom headers like Cloudflare access tokens to be included in the initial get_token() request.
Changes
This pull request refactors how default headers are set up. I've made modifications to ensure that custom headers, when provided, are incorporated correctly before any web requests.
The key changes include:
The custom headers are merged before the self.get_token() method is called.
Ensuring that custom headers such as Cloudflare access tokens are included in all requests.
Maintaining the default headers like 'Authorization' and 'Content-Type', ensuring they are not overwritten.
Reason
The motivation behind these changes is to ensure custom headers are available before any web requests requiring headers are made. This was a particular error when using KeycloakOpenIDConnection for KeycloakAdmin.
Hi this is my first contribution to this project, and I hope I'm doing this right. If there's anything I've missed or any additional information you need, please let me know.
Overview
Refactor of
KeycloakOpenIDConnection
, settingheaders
andcustom_headers
before any web request requiring any custom headers. This allows custom headers like Cloudflare access tokens to be included in the initialget_token()
request.Changes
This pull request refactors how default headers are set up. I've made modifications to ensure that custom headers, when provided, are incorporated correctly before any web requests.
The key changes include:
self.get_token()
method is called.'Authorization'
and'Content-Type'
, ensuring they are not overwritten.Reason
The motivation behind these changes is to ensure custom headers are available before any web requests requiring headers are made. This was a particular error when using
KeycloakOpenIDConnection
forKeycloakAdmin
.