# Realm specific properties for login page theme

**URL:** <https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336>\
**Category:** Extending the server\
**Created:** [October 13, 2020, 12:27pm UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336 "2020-10-13T12:27:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjoernhype](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/bjoernhype/32/2318_2.png) [@bjoernhype](https://forum.keycloak.org/u/bjoernhype)\
**Post date:** [October 13, 2020, 12:27pm UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/1 "2020-10-13T12:27:15Z")

</div>

In a multi tenant system, we use only one instance of keycloak with many realms, each for one customer.  
We don’t wan’t one theme per realm/customer, but one central theme where some realm/customer specific values can be used. Is it possible to store realm specific values in keycloak, and use them as placeholders for the theme? That would be great for multi tenancy

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [October 14, 2020, 8:13am UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/2 "2020-10-14T08:13:52Z")

</div>

I didn’t test it, but should be possible.  
The RealmModel object is available in login theme context. And in a realm you can store custom attributes (but only programmatically, not from the UI).  
This should make it possible to get what you want!?

---

<div class="post-metadata">

**Author:** ![bjoernhype](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/bjoernhype/32/2318_2.png) [@bjoernhype](https://forum.keycloak.org/u/bjoernhype)\
**Post date:** [October 14, 2020, 8:33am UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/3 "2020-10-14T08:33:50Z")

</div>

Thank you for your reply.  
I couldn’t find any documentation or hint on this, but I will investigate if and how I can write realm custom attributes by REST API. If that’s possible, and they can be read in login theme context from the realm, that would help me a lot 🙂

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [October 14, 2020, 8:40am UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/4 "2020-10-14T08:40:32Z")

</div>

It’s an undocumented feature 😉  
The property in RealmModel is named `attributes` and it’s a Map.  
See [https://github.com/keycloak/keycloak/blob/master/server-spi/src/main/java/org/keycloak/models/RealmModel.java#L124](https://github.com/keycloak/keycloak/blob/master/server-spi/src/main/java/org/keycloak/models/RealmModel.java#L124)

---

<div class="post-metadata">

**Author:** ![bjoernhype](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/bjoernhype/32/2318_2.png) [@bjoernhype](https://forum.keycloak.org/u/bjoernhype)\
**Post date:** [October 14, 2020, 1:26pm UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/5 "2020-10-14T13:26:05Z")

</div>

`RealmModel` doesn’t help here because on the login page we have only access to `RealmBean`, which wraps RealmModel and hides `attributes`.  
But we have also access to the current client of the realm, which has a map of `attributes`, too.  
So thanks to your hint we found this and are optimistic to solve our issues. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [October 14, 2020, 1:47pm UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/6 "2020-10-14T13:47:58Z")

</div>

You’re welcome! 🙂

---

<div class="post-metadata">

**Author:** ![eicki](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/eicki/32/1860_2.png) [@eicki](https://forum.keycloak.org/u/eicki)\
**Post date:** [February 8, 2021, 12:55am UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/7 "2021-02-08T00:55:57Z")

</div>

Is there an easy way to extend RealmBean? My issue is quite similar and I’m also thinking of using ClientBean attributes. But this doesn’t help for theming the account management console which only gives me access to a RealmBean which does not offer access to the realm attributes.

Or different approach, can I extend the FreeMarkerLoginFormsProvider/FreeMarkerAccountProvider in an easy way?

---

<div class="post-metadata">

**Author:** ![bjoernhype](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/bjoernhype/32/2318_2.png) [@bjoernhype](https://forum.keycloak.org/u/bjoernhype)\
**Post date:** [February 8, 2021, 8:18am UTC](https://forum.keycloak.org/t/realm-specific-properties-for-login-page-theme/5336/8 "2021-02-08T08:18:02Z")

</div>

Hi Eicki,  
you can check if you can solve it the same way we did successfully, without extending or modifying keycloak: There is a special client for the account management console (I think ‘account-console’). So by using “client.attributes[attributeName]” you should reach your individual attributes.  
Greetings, Björn
