python-keycloak
python-keycloak copied to clipboard
`keycloak.exceptions.KeycloakGetError: 431: b''` error due to exceeeded header size
-
Reason
- Large number of realms and realm config in kecycloak server
- resulting in large headers in
ConnectionManager
-
requests
returning with431
for all GET and POST requests
-
Solution
- deleting a few realms decreased the header size and requests were successful
But there should be better handling??
I am running into the same issue. If the service account I'm using has the admin
role, I started running into this issue after creating several realms, because the account is inheriting all of the client roles for the <realm_name>-realm
clients.
Try disabling full scope allowed from the client settings of the client you use for access. This worked for me, reduced the headers. Enabling full scope will add too much header data, which might not be required for your case.
@vipul43 thank you! That one has been bugging me for a while!