Thanks for your quick response!
Yes and no :)
Embedding theme-resources in a .jar via `/theme-resources` allows me to
provide resources that I can refer to
from my extensions. However, in my case, the Keycloak admin-console looks
for the IdP specific HTML files under
$KEYCLOAK_HOME/themes/base/admin/resources/partials/*-ext.html
which don't seem to provide a way to add those files via embedded
`/theme-resources` such that they can be
found by the admin-console.
So currently I need to either copy files myself or create a custom theme.
But in every case, I need to at least 2 things:
1, deploy IdP.jar
2. deploy theme + configure theme or copy files to the Keycloak base theme.
What I actually want is to just deploy my IdP.jar with all the resources
(two HTML files) embedded.
Cheers,
Thomas
On Fri, Aug 3, 2018 at 2:36 PM Dmitry Telegin <dt(a)acutus.pro> wrote:
Hi Thomas,
On Fri, 2018-08-03 at 14:04 +0200, Thomas Darimont wrote:
> Hi Dmitry,
>
> Yes, I'm currently "patching" the Keycloak theme, but only by
/adding/
HTML files for my IdP which are dynamically
> resolved by the Keycloak admin-console.
> Sure, I could create a custom theme derived from the Keycloak base theme
which contains just my additional IdP
> HTML files, but then I'd need to configure the theme for every realm
where I need my IdP.
>
> I agree with you that patching the Keycloak theme by changing files is
not a good idea, but adding files required
> for an extension like a custom IdP or an authenticator should IMHO be a
supported use case.
But isn't it what Theme Resources are exactly?
https://www.keycloak.org/docs/latest/server_development/index.html#_theme...
Dmitry
> Extensions should IMHO allow declaring embedded resources
(templates/css/js/images) which should be resolved by Keycloak,
> similar to how themes work.
>
> Cheers,
> Thomas
>
> > On Thu, Aug 2, 2018 at 2:06 AM Dmitry Telegin <dt(a)acutus.pro> wrote:
> > Hi Thomas,
> >
> > (skipped)
> >
> > > My current deployment script contains the following:
> > > ...
> > > echo install new acme-identityprovider
> > > cp target/*.jar $KEYCLOAK_HOME/standalone/deployments
> > >
> > > echo install new theme page
> > > cp -r src/main/resources/themes/* $KEYCLOAK_HOME/themes
> > > ...
> > >
> > > This copies the associated HTML files to
> > >
themes/base/admin/resources/partials/realm-identity-provider-acme.html
> > >
themes/base/admin/resources/partials/realm-identity-provider-acme-ext.html
> >
> > So you are actually patching Keycloak base theme? You're a cheater!
:-D This is not how GUI modifications are done in Keycloak normally.
> >
> > If you're on KC 4.0.0+, seems like Theme Resources is what you're
looking for:
> >
https://www.keycloak.org/docs/latest/server_development/index.html#_theme...
> >
> > Otherwise, the recommended way is to create a custom theme, inherit it
from Keycloak stock theme and extend it with your content. You can put your
theme into the same JAR to have it hot deployed (see KEYCLOAK-4547), but
also only if you're on KC 4.0.0+.
> >
> > Cheers,
> > Dmitry Telegin
> > CTO, Acutus s.r.o.
> > Keycloak Consulting and Training
> >
> > Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
> > +42 (022) 888-30-71
> > E-mail: info(a)acutus.pro
> >
> > >
> > > Cheers,
> > > Thomas
> > > _______________________________________________
> > > keycloak-user mailing list
> > > keycloak-user(a)lists.jboss.org
> > >
https://lists.jboss.org/mailman/listinfo/keycloak-user
> >