The Elina
The Elina

Reputation: 19

How to dynamically set keycloak theme from the URL?

I am been looking at keycloak documentation, and while I have figured out how to create custom login pages, I can not seem to find the way to send information to keycloak, in the url, about what theme to use. I have a dark theme and a light theme on my website, and I want it so that when the user goes to keycloak from either dark mode or light mode, that keycloak page matches what is from my website. The only thing I found was about some argument to pass in the url of kc_theme='name of theme', but that does not seem to be working.

"http://localhost:8081/realms/customer-portal/protocol/openid-connect/auth?client_id=customer-portal&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Flogin-callback&response_type=code&scope=openid&login_theme=my-dark-theme&prompt=login".

What can I do to fix this?

Upvotes: 0

Views: 48

Answers (0)

Related Questions