添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating to 22.0 we are receiving an internal server error when we try to impersonate:

We found the error Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "index.ftl".

We customized the template /realms/realmsIDName/account/ but never had index.ftl inside the account folder on templates.

Maybe it's an issue, moving to issue

I have encountered the same problem.

We are using custom theming for most pages (Acount, Email, Login and Welcome). All themed pages except Account page work in Keycloak 22.

The Account theme breaks in Keycloak 22 due to missing "index.ftl". Our account theme never had an "index.ftl"

We have configured parent=base in theme.properties .

After switching the Admin UI theme to "Base," an error occurred when attempting to access the keycloak login #21421

@pedroigor : yes, using the base theme itself is broken since Keycloak 21. However, using the base theme as the parent for a custom theme worked fine until Keycloak 22.

Using parent=base for a custom theme is the official way documented here , but this doesn't work anymore for Admin and Account type themes.

Having the same issue here. We did an extensive overhaul of the Account Console that uses base/keycloak as parent and we cant access the Account Console anymore due to the missing index.ftl.

Currently forced to stay in v21.1.1. It will be a big issue for us if our Keycloak as a Service Provider decides to update to v22 before this is fixed since our users wont be able to access their Profile.

The reason this stopped working in 22 is the removal of Account Console v1, which is at the same time stopping themes using the older account console from working.

A workaround that should work for now is to update the custom account theme to work with the newer Account Console v2, and use parent=keycloak.v2 instead of parent=base .

I think it would make sense to introduce a base theme for Account Console v2 as well, that is basically functional, but without any styling, while keycloak.v2 adds the standard PatternFly styling only.

Many may not know this, but our REST APIs use message bundles stored in the themes. This is obviously wrong as the REST API should not have to know about a theme when formulating an error message. These messages should stored somewhere that they can be accessed globally. I can't think of a use case where you would want a server-side error message to care about what theme is active.

This was the motivation for #22671

Other thoughts:

  • I agree that we need to eventually get rid of the versioned themes if we can.
  • It will be awhile before the base theme goes away because it is so essential for custom versions of login.
  • No matter what, I don't want to see multiple copies of the same message bundles.
  • Due to the amount of issues reported by the community we are not able to prioritise resolving this issue at the moment.

    If you are affected by this issue, upvote it by adding a 👍 to the description. We would also welcome a contribution to fix the issue.

    @parvuselephantus Can you share details of the template you use for account console:

  • Which theme do you use?
  • Is it a built-in or customized in any way?
  • If customized, what is its parent theme?
  • I ran out of time and don't have exactly what I used to have. However I started from 20.0.5 environment to upgrade into 24.0.1. I used a customized theme, which was a modified base theme. The parent=base. Later on I played with versions of parent=keycloak* - some worked some didn't. I'm not any great on keycloak - not sure when template is applied and when not (when the restart is needed) - played also with index.ftl being copy of accoun.ftl or just empty file - interesting in some cases (can't remember now which) it started fine, but even though eg having index.ftl empty I saw the account page with the content that seems to me to be the default (one of keycloak* versions).
    From the discussion I understand now the 'parent=' idea is planned to be scrapped and I should rather copy full theme and change it (instead of copying only modified files). Just wanted to mention, that if you go this path, remember that I will need to take care of multiple files I never modified (if you change variable naming convention). Keeping fingers crossed for you all, to accomplish full backward compatibility :)

    I ran into this yesterday when creating a custom theme. I resolved the problem, but after reading through this issue I am left wondering what the current suggested way of implementing and maintaining a custom theme is.

    I currently implemented my theme as following the instructions in the documentation repo. E.g.:

    parent=base
    import=common/keycloak
    styles=...
    

    However, is it better to copy the whole base-theme and make changes, instead of inheriting from it?

    @Lisser - that will not work for you long term, because Keycloak seems to change base often. So variable markers will get obsolete on next update and you will have to update lots of code you have never written (just copied). If I recall (sorry - it was over a month and with such a volume of issues I don't remember each one) the way to go for me was to use parent=kecyloak3 (I think keycloak 3 was the newest month ago). Copy only files you want to alter - the other should be updated as Keycloak updates are released (you will need to reimplement files you changed on some updates later on). Also if I recall there was idea to make parent= setting obsolete... but we never know which path will Keycloak go.

    Alright! I'll keep my extension of base for now, it's not much and should be easily ported to a new realease.

    I'm curious to hear the official stance on how theme development should be done in the future. If you need help rewriting the documentation at any point, don't hesitate to reach out