mayope / keycloakmigration

Manage your Keycloak configuration with code.
https://mayope.net
MIT License
108 stars 22 forks source link

Migrate without "list realm" permission in keycloak #15

Closed Soerinho closed 4 years ago

Soerinho commented 4 years ago

When using the plugin i tried to start a migration without the permission to list the keycloak realms. In this case i got the following error: Instantiation of [simple type, class de.klg71.keycloakmigration.model.Realm] value failed for JSON property id due to missing (therefore NULL) value for creator parameter id which is a non-nullable type at [Source: (BufferedReader); line: 1, column: 25] (through reference chain: java.util.ArrayList[0]->de.klg71.keycloakmigration.model.Realm["id"])

klg71 commented 4 years ago

Hello @Soerinho thanks for opening this issue! :) The rootCause behind this bug is, that if you dont have the permission to inpect the realm you are on, you only get a reduced realm list from the /auth/admin/realms endpoint. I should be able to prepare the fix in the version 0.1.34 today.

klg71 commented 4 years ago

Released version 0.1.34. Please review the fix @Soerinho and reopen if needed :)

Soerinho commented 4 years ago

Hi @klg71 my test was successful :-) Thx for the quick fix 👍