p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
389 stars 66 forks source link

How to declaratively configure the custom admin UI theme? #27

Closed phamann closed 1 year ago

phamann commented 1 year ago

To use this extension implementors must set the Keycloak admin console theme to the custom phasetwo.v2 theme in order to make organization UI pages visible/useable. This can be achived manually via the admin console and the preference is then persisted to the database for subsquent uses.

Ideally we would like to declaritively configure the phasetwo.v2 ui as the default UI on application boot, either via an environment variable, realm import, or similar. I have attempted to work out how to do this and researched many forum posts, documentation etc without success.

How does phasetwo solve this problem? Do you know of a way to declarivitely configure the default admin ui?

Apologies if this is the wrong location/repository to ask such a question, please feel free to redirect me if wrong.

Many thanks.

xgp commented 1 year ago

You can set the admin theme a few ways:

  1. If you are referring to the master realm, you can import a realm config file during first startup that specifies the phasetwo.v2 theme. Docs on how to do that are in the Keycloak guides: https://www.keycloak.org/server/importExport
  2. Any time you create a realm (non-master), you can give it a realm config file that specifies the phasetwo.v2 theme.
  3. If you are applying configuration to existing realm, you can use something like this https://github.com/adorsys/keycloak-config-cli to set the theme.

However, I don't know of a way to make it the "default" as you say.