How do I enable maintenance mode in KC, which means redirecting customer dashboards to a single page, in this case the user accounts dashboard will redirect to maintenance page?
so for example

and the other Keycloack customer dashboards will be redirect to something like

this my be done manually by toggle some option?
I had a similar request and found a way to make it "sort of maintainable" for us.
But in my case, I had an NGINX reverse proxy running in front of keycloak.
To do Maintenance, we "disable" the Realm in Keycloak

Any request to the disabled realm returns HTTP Status 400, so we react on this in the NGINX reverse proxy config and return our "Maintenance Page"
proxy_intercept_errors on;
error_page 400 /maintenance.html;
location = /maintenance.html {
internal;
root /usr/share/nginx/html;
}
In my case, we host the "Maintenance Page" directly on the NGINX host.
But you could aswell return a temporary redirect like
proxy_intercept_errors on;
error_page 400 @maintenance;
location @maintenance {
return 302 https://yoursite.com/maintenance
}
But this is not a perfect solution.
Ideally, I want my "Testaccounts-Audience" still be able to log in. So that we can verify the new config works as expected. And all other users e.g. "Productionaccounts-Audience" to receive a "Maintenance Page".
If someone can propose a good solution for this - keeping the realm "enabled" only for a test-audience, but redirect all other users, I'd appreciate it.
Regards, Erich
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With