Peter-Slump / django-keycloak

Django app to add Keycloak support to your project.
MIT License
126 stars 120 forks source link

Bad Request For Permission Synchronisation #59

Open SamBugler opened 3 years ago

SamBugler commented 3 years ago

When trying to synchronise permissions from the admin panel, I get the following error

KeycloakClientError at /admin/django_keycloak/realm/ 400 Client Error: Bad Request for url: https://DOMAIN/auth/realms/REALM/protocol/openid-connect/token

The service account has the appropriate permissions and client credentials grant type is activated

Keycloak version is 12.0.4

SamBugler commented 3 years ago

Seems to be related to 'scope': 'realm-management openid'. This scope isn't available, at least in the latest version of keycloak. Work around was to just create this scope and add it to client then it worked.

pmahindrakar commented 2 years ago

@SamBugler Thanks for the input. I was also facing similar error and after adding 'scope': 'realm-management openid' to the client , above error was resolved. However I am getting "KeyError at /admin/django_keycloak/realm/" "refresh_token". Any specific mappers to be used in 'scope': 'realm-management openid' ??

I am using KeyCloak 12.0.4.