Keycloak FTL:如何访问会话已结束或用户在自定义主题的登录模板中注销的模板变量

问题描述

我正在使用Keycloak作为React应用程序的身份验证,并通过修改login.ftl文件来自定义登录页面。根据Keycloak的文档,我正在template.ftl中导入login.ftl文件,一切正常。在template.ftl文件中,我可以像这样访问模板变量,

<#if displayMessage && message?has_content && (message.type != 'warning' || !isAppInitiatedAction??)>
          <div class="alert alert-${message.type}">
              <#if message.type = 'success'><span class="${properties.kcFeedbackSuccessIcon!}"></span></#if>
              <#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon!}"></span></#if>
              <#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon!}"></span></#if>
              <#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon!}"></span></#if>
              <span class="kc-feedback-text">${kcSanitize(message.summary)?no_esc}</span>
          </div>
      </#if>

考虑到这一点,有一种方法可以访问template.ftllogin.ftl文件中的模板变量,该变量将提供有关会话刚刚结束或用户已重定向到登录页面的信息。因为他们刚登出?当用户注销后重定向到登录页面时,我想在template.ftllogin.ftl中显示用户刚刚注销的消息UI。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...