how to write custom keycloak themes api

241 views
Skip to first unread message

vidhyadharan D

unread,
Mar 22, 2021, 12:23:39 PM3/22/21
to Keycloak User
Hi,

I see redhat keycloak themes https://sso.redhat.com/ have apis such as loginExistshttps://sso.redhat.com/auth/realms/redhat-external/rhdtools/loginExists , usernameUsed https://sso.redhat.com/auth/realms/redhat-external/rhdtools/usernameUsed These API 's are custom designed ? Could you please explain how to write custom theming keycloak api. I would like to expose an api for password policies , so that I can customize on the client side.

Thanks,
vidhya 

Garth

unread,
Mar 22, 2021, 12:58:56 PM3/22/21
to keyclo...@googlegroups.com
Looks like they have added the `loginExists` and `usernameUsed` functions as REST extensions. You can do the same by creating a custom `RealmResourceProvider`:
https://www.keycloak.org/docs/latest/server_development/#_extensions_rest

Custom theme documentation is here:
https://www.keycloak.org/docs/latest/server_development/#_themes
Also, I created a template to help you start making your own theme:
https://github.com/xgp/keycloak-theme-template

Ask further questions here if you get stuck.

On Mon, Mar 22, 2021, at 5:23 PM, vidhyadharan D wrote:
> Hi,
>
> I see redhat keycloak themes https://sso.redhat.com/ have apis such as
> *loginExists*,
> https://sso.redhat.com/auth/realms/redhat-external/rhdtools/loginExists
> , *usernameUsed*
> https://sso.redhat.com/auth/realms/redhat-external/rhdtools/usernameUsed These API 's are custom designed ? Could you please explain how to write custom theming keycloak api. I would like to expose an api for password policies , so that I can customize on the client side.
>
> Thanks,
> vidhya
>
> --
> You received this message because you are subscribed to the Google
> Groups "Keycloak User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to keycloak-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/keycloak-user/c7528e33-333f-4715-a266-51bb2ac6e695n%40googlegroups.com <https://groups.google.com/d/msgid/keycloak-user/c7528e33-333f-4715-a266-51bb2ac6e695n%40googlegroups.com?utm_medium=email&utm_source=footer>.

vidhyadharan D

unread,
Mar 22, 2021, 9:31:52 PM3/22/21
to Garth, keyclo...@googlegroups.com
By default we authenticate with OAuth token , whereas in themes we don’t have user ID/ password , how this REST extension works . 

You received this message because you are subscribed to a topic in the Google Groups "Keycloak User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/keycloak-user/k3jOtBE_JX4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/7e9b06e8-24cd-4301-9c34-cac743943f25%40www.fastmail.com.
Reply all
Reply to author
Forward
0 new messages