从 freemarker 模板重置身份验证流程
有没有办法从 freemarker 模板中重置当前的身份验证流程?我们有一个复杂的登录过程,具有多个链式身份验证器。大多数身份验证器的质询响应上还有一个 cancel
按钮,目前该按钮是带有 href="${url.loginUrl}"
的锚标记但单击它并没有达到预期的效果:Keycloak 会记住身份验证会话的状态,因此不会返回到开头,而是会重新加载当前身份验证器页面。在身份验证器的代码中,可以使用 context.resetFlow()
恢复身份验证会话的原始状态。 freemarker 也有办法做到这一点吗?
编辑:我当前的解决方案是在模板中使用 href=${url.loginUrl}&reset=true
并在身份验证器中检查该查询参数然后触发resetFlow
。我想知道是否有更好的方法。
Is there a way to reset the current authentication flow from within a freemarker template? We have a complex login process with multiple chained authenticators. There is also a cancel
button on most of the authenticators' challenge responses, which, at the moment, is an anchor tag with href="${url.loginUrl}"
but clicking it doesn't have the desired effect: Keycloak remembers the state of the authentication session and thus instead of going back to the beginning, the current authenticator page simply reloads. Within the authenticator's code there is the possibility of context.resetFlow()
to restore a pristine state of the authentication session. Is there a way to do this from freemarker as well?
Edit: my current solution is to use a href=${url.loginUrl}&reset=true
in the template and a check on that query parameter in the authenticator which then triggers resetFlow
. I wonder if there is a better way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)