Dynamic Realm management

Hi All here.
I’m a multi-tenant resource server and I managed to have an authorisation server running with spring boot. Now I want to change the authorisation server to Keycloak and I’m facing certain issues and the main is:

Is there an SPI for realm lookup from external database?

In my actual authorisation server, I manage (CRUD) all realms and clients dynamically thus I don’t want to change to Keycloak if I’m not able to ensure this anymore.

You can extend SPI to lookup user from external database. You can find the documentation on the keyckloak site.

My issue is not about users but realms. So right, I can make use of SPI for user resolving, but not for Realm resolving, which is my problem