python-keycloak icon indicating copy to clipboard operation
python-keycloak copied to clipboard

`keycloak.exceptions.KeycloakGetError: 431: b''` error due to exceeeded header size

Open vipul43 opened this issue 1 year ago • 3 comments

  • Reason

    • Large number of realms and realm config in kecycloak server
    • resulting in large headers in ConnectionManager
    • requests returning with 431 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??

vipul43 avatar May 31 '23 09:05 vipul43

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.

jcputney avatar Oct 10 '23 14:10 jcputney

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.

image

vipul43 avatar Oct 10 '23 14:10 vipul43

@vipul43 thank you! That one has been bugging me for a while!

jcputney avatar Jan 06 '24 00:01 jcputney