opensingular / singular-keycloak-database-federation

Keycloak User Storage SPI for Relational Databases (Keycloak User Federation, supports postgresql, mysql, oracle and mysql)
Apache License 2.0
116 stars 56 forks source link

Allow to remove Keycloak User (not the linked RDBMS database record) with a new setting #13

Closed dla-c-box closed 2 years ago

dla-c-box commented 2 years ago

The new setting looks like this and is OFF by default: image

Before this PR (and still the case if the parameter stays OFF), if you try to click "Delete" on a Keycloak User fetched by the plugin, you get the error "Error! User couldn't be deleted": image

The PR adds the possibility, when the new setting is ON, to let Keycloak delete its version of the user (not the user record in the linked RDBMS), allowing the user to be re-fetched from scratch from the RDBMS on the next sync. This is useful for testing, but also to solve sync issues for given users.

Note that the addUser method is implemented to satisfy the UserRegistrationProvider interface, but does nothing more than before: it just lets the call pass through, as per the recommendation in the Keycloak documentation here: https://www.keycloak.org/docs/latest/server_development/#:~:text=The%20addUser()%20method%20will%20be%20called

viniciusuriel commented 2 years ago

Nice addition, every time I had to change some user data I ended up cleaning the entire user base in order to perform a hard reload.