Closed
Description
Description
Currently, DefaultThemeManagerFactory
is an internal class and can't be accessed/overridden by extensions.
Discussion
No response
Motivation
It is desirable to allow other extensions to override and/or use the functionality of this class.
For example, the clearCache
method in DefaultThemeManagerFactory
is not exposed via any public SPI, so you cannot directly access it in a standard Keycloak extension. An author of a ThemeProvider
or ThemeSelector
may want to access this as part of building a dynamic Theme
that changes at runtime.
Details
To implement:
- create a
ThemeManagerSpi
class - expose the current
DefaultThemeManagerFactory
methods as aThemeManagerFactory
interface - update the code that uses the
DefaultThemeManagerFactory
(looks like only theDefaultKeycloakSessionFactory
andDefaultThemeManager
) to load the implementation usingsession.getProvider...
I'll submit a PR in a few days.