# ThemeSelectorProviderFactory not used by keycloak 7

**URL:** <https://forum.keycloak.org/t/themeselectorproviderfactory-not-used-by-keycloak-7/534>\
**Category:** Configuring the server\
**Created:** [November 27, 2019, 8:11am UTC](https://forum.keycloak.org/t/themeselectorproviderfactory-not-used-by-keycloak-7/534 "2019-11-27T08:11:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jmrodriguez](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jmrodriguez](https://forum.keycloak.org/u/jmrodriguez)\
**Post date:** [December 22, 2020, 5:59pm UTC](https://forum.keycloak.org/t/themeselectorproviderfactory-not-used-by-keycloak-7/534/3 "2020-12-22T17:59:47Z")

</div>

For whoever needs something like this in the future, including my future self.

In order to make your custom theme selector SPI actually work (might apply to other types of SPIs, interestingly not for UserStorageProviders though, those work just fine as per the documentation), you need to declare it as the default one so it takes over DefaultThemeSelectorProvider.

Otherwise, although your custom provider is initialized, the create method in the Provider Factory class is never called.

In order to declare your Theme Selector as the default one, instead of declaring it like this (as documented [here](https://www.keycloak.org/docs/latest/server_development/index.html#implementing-an-spi)):

```
<spi name="themeSelector">
       <provider name="my-theme-selector-provider" enabled="true"/>
</spi>

```

You should declare it like this:

```
<spi name="themeSelector">
       <default-provider>my-theme-selector-provider</default-provider>
       <provider name="my-theme-selector-provider" enabled="true"/>
</spi>

```

and voilá.

The main cause of this problem is perhaps that Keycloak doesn’t seem to have a section in the admin interface to specify that your custom SPI should be used instead of the default one (or at least I haven’t found any).

Worth mentioning that I did all this on Keycloak 11, not in version 7.

---

_[View the full topic](https://forum.keycloak.org/t/themeselectorproviderfactory-not-used-by-keycloak-7/534)._
