Gatekeeper Deep-Links Redirect Url http://my-host.com#test

Yes I secured my Frontend-Data mit Gatekeeper and yes I know it’s not best practice, but I am quite restricted on this (no frontend-side changes are allowed)

So i change from http://my-host1.com to http://my-host2.com#test. I get redirected and after the login the hash-link is swallowed into the abyss.

Is it possible to do this, just by adapting some magical configuration in gatekeeper or keycloak?

cheers && thx
Sebastian

I had the same problem. I fixed it by modifying themes/base/login/login.ftl

<form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="${url.loginAction}" method="post">

Changes to:

<form id="kc-form-login" onsubmit="this.action = this.action + window.location.hash; login.disabled = true; return true;" action="${url.loginAction}" method="post">

It appends the hash from the URL onto the form post action when it’s submitted. The key to fixing this was finding out that the hash is never sent to the server, but is fully controlled by the web browser.

I also posted this answer to Stack Overflow

1 Like