简体   繁体   English

Keycloak跳过身份验证流程(选择用户)

[英]Keycloak skipping a Authentication flow ( Choose User)

Using keycloak 4.1 version. 使用keycloak 4.1版本。 Added Custom flow to reset password to send SMS OTP instead of email. 添加了自定义流程以重置密码以发送SMS OTP而不是电子邮件。

Step 1 : Choose user ( Validates a user) Step 2 : Send OTP and validate form Step 3 : Reset password 步骤1:选择用户(验证用户)步骤2:发送OTP并验证表单步骤3:重置密码

I am facing a problem in step 2. If user already authenticated and click back from step 2, I can't go to step 1 to enter another user id / email id. 我在步骤2中遇到问题。如果用户已通过身份验证,然后从步骤2中单击返回,则无法转到步骤1输入另一个用户ID /电子邮件ID。 It skips that step 1 and keep on coming directly to step 2 "Send and validate otp form" when clicking back or clicking forgot password link again. 当单击返回或再次单击“忘记密码”链接时,它将跳过第1步,继续直接进入第2步“发送并验证otp表单”。

Step one configured as requiresUser() False and Step2 configured requiresUser() True 步骤1配置为requireUser() ,步骤2配置为requireUser() 正确

Is there any way to restart session / flow when clicking back ${url.loginResetCredentialsUrl} in ftl file? 在ftl文件中单击$ {url.loginResetCredentialsUrl}时,是否有任何方法可以重新启动会话/流?

If I understand you correctly you are developing something that is managed by administrator who can reset passwords of different users and that trigger sending a message. 如果我理解正确,那么您正在开发的内容是由管理员管理的,管理员可以重置其他用户的密码并触发发送消息。 I think you can just logout the user via javaScript in your ftl file and then try to redirect him to step 1. You can find in admin panel of keycloak what request is sending via network panel in dev tools when you click logout session for the user. 我认为您可以仅通过ftl文件中的javaScript注销用户,然后尝试将其重定向到步骤1。您可以在keycloak的管理面板中找到当用户单击注销会话时在开发工具中通过网络面板发送的请求是什么。

Use ${url.getLoginRestartFlowUrl()} to restart login flow. 使用$ {url.getLoginRestartFlowUrl()}重新启动登录流程。 That will reset user session information. 这将重置用户会话信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM