-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
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
Theme Resources are not loaded #33
Comments
I vaguely remember poking this code for a similar reason, but I can't provide you with a ready-made solution or explanation. I can say that it's the responsibility of the |
Actually, scratch that. I've reread your post, as well as my own code on the matter. You're attempting to use theme resources - a (confusingly named) mechanism to inject resources, such as message bundles and HTML for a plugin, regardless of the selected theme. This is exactly the use case I had, and for me it was enough to add this class (in Scala, but you get the picture): final class EmbeddedThemeResourceProviderFactory
extends ClasspathThemeResourceProviderFactory(
"embedded-resources",
classOf[EmbeddedThemeResourceProviderFactory].getClassLoader
) , and wire it up in |
Hey @nigredo-tori, thanks for rechecking the ticket! Your solution works perfectly, thanks a lot! The reason it wasn't working for me is that I hadn't looked and so didn't know about the Nevermind: it works with the @thomasdarimont I think this is something the embedded-spring-boot-keycloak-server should come with out of the box, since it works that way in Wildfly out of the box too, what do you think? |
I did look into this a while ago in this branch support-theme-components where I tried to adapt the theme resource loading to the mechanisms that are used by Keycloak on wildfly. I'll try to give this another spin on the weekend. |
The embedded spring boot keycloak server seems not to be able to load theme resources out of the box. I was trying to include this identity provider extension:
https://github.com/BenjaminFavre/keycloak-apple-social-identity-provider
In its documentation, it is referring to the Keycloak Deployer, which we don't have in this project's context (I guess?). So I just included the provider Jar in the classpath (Spring-Boot style). The provider showed up in the admin console's list of identity providers but when I chose it, I got a 404 error indicating a missing resource. Diving into the provider's code showed that some html files located in
theme-resources/resources/partials/
should have been accessible but actually aren't.After I found the corresponding part of the Keycloak documentation, I wrote a quick and dirty
ThemeResourceProvider
that would just look up the resource in the classpath underneath the documentedtheme-resources/resources/
prefix and voila: it worked for the html files.The identity provider still seems to be missing its message resources though, but there's no such thing as a
MessageResourceProvider
so I don't think I can monkey-patch that one in.TL;DR: the mechanism that loads theme resources (resources, messages and probably also templates) described here doesn't seem to work in the embedded spring boot keycloak server.
The text was updated successfully, but these errors were encountered: