- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在 Keycloak 中实现这个身份验证流程:
此流程的目标是最简单,吸引不习惯网络应用程序的用户。
我会做的实现:
密码验证
和配置文件验证
规则自定义Keycloak注册
流程UPDATE_PASSWORD
我得到了一些有用的东西,但是:
一个。通过电子邮件收到的链接重定向到确认执行操作的中间页面(“执行以下操作”)-(类似于 Keycloak Implement Reset password flow same as forgot password flow )
B.然后用户将被重定向到登录页面,而不是直接连接到应用程序。
作为普通用户,当我触发重置密码请求(通过“忘记密码”功能)时,过程就是我想要的:通过单击电子邮件链接,我直接进入允许我输入的页面并确认新密码,然后我就通过了身份验证。
我的问题:您是否找到了实现这种“简化”流程的方法?
我的 key 斗篷版本:11.0.2
谢谢!
最佳答案
我可以删除“info.ftl”页面显示,自定义“ExecuteActionsActionTokenHandler”,如下所述:
你必须创建一个文件:
src/main/resources/META-INF/services/org.keycloak.authentication.actiontoken.ActionTokenHandlerFactory
包含您要改用的类的名称:
com.example.ExecuteActionTokenHandlerFactory
然后使用以下代码创建该类 com.example.ExecuteActionTokenHandlerFactory :
public class ExecuteActionTokenHandlerFactory extends ExecuteActionsActionTokenHandler {
@Override
public Response handleToken(ExecuteActionsActionToken token, ActionTokenContext<ExecuteActionsActionToken> tokenContext) {
AuthenticationSessionModel authSession = tokenContext.getAuthenticationSession();
String redirectUri = RedirectUtils.verifyRedirectUri(tokenContext.getUriInfo(), token.getRedirectUri(),
tokenContext.getRealm(), authSession.getClient());
if (redirectUri != null) {
authSession.setAuthNote(AuthenticationManager.SET_REDIRECT_URI_AFTER_REQUIRED_ACTIONS, "true");
authSession.setRedirectUri(redirectUri);
authSession.setClientNote(OIDCLoginProtocol.REDIRECT_URI_PARAM, redirectUri);
}
token.getRequiredActions().stream().forEach(authSession::addRequiredAction);
UserModel user = tokenContext.getAuthenticationSession().getAuthenticatedUser();
// verify user email as we know it is valid as this entry point would never have gotten here.
user.setEmailVerified(true);
String nextAction = AuthenticationManager.nextRequiredAction(tokenContext.getSession(), authSession, tokenContext.getClientConnection(), tokenContext.getRequest(), tokenContext.getUriInfo(), tokenContext.getEvent());
return AuthenticationManager.redirectToRequiredActions(tokenContext.getSession(), tokenContext.getRealm(), authSession, tokenContext.getUriInfo(), nextAction);
}
}
其实和上层类的实现是一样的,只是去掉了下面的部分:
if (tokenContext.isAuthenticationSessionFresh()) {
...
}
这意味着如果用户没有 session (当用户重置密码时发生),他将被重定向到该“info.ftl”页面。
关于 key 斗篷 : implement "reset password" (as admin) flow same as "forgot password" (as user),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66861665/
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我有一个具有多种语言的 Magento 网站。我已经设置了语言包,网站上的所有内容似乎都能正确翻译。此外,交易电子邮件均以正确的语言发送,“忘记密码”电子邮件除外,该电子邮件始终以德语发送。这是我所做
我使用 SFHFKeychainUtils 有一段时间了。在我上次更新 AppStore 时,它突然“忘记”了我的用户密码。这意味着,当为相同的用户名和服务调用 getPasswordForUse
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Forgot Password: what is the best method of implementing a
这个问题在这里已经有了答案: Is this fire and forget approach correct? (2 个答案) Fire and forget without async void
我想尝试不同类型的 bean 作用域。所以我写了一个测试环境,它应该生成一个随机数,这样我就可以看到一个 bean 是否发生了变化。我的测试设置不起作用,我无法解释我发现了什么。 我正在使用 Spri
我有 md5 格式的密码数据库条目,但是当用户使用“忘记密码”时,我该如何给他/她所需的密码? 最佳答案 你不能从 MD5 散列中做到这一点;你也不应该能够。密码恢复应该是棘手的。 通常的过程是将密码
当你运行 perl -e "Bla->new" ,你会得到这个众所周知的错误: Can't locate object method "new" via package "Bla" (perhaps
我们在门户中使用 Keycloak 12 进行身份验证,并且有两种不同类型的用户: 内部用户(从我们的内部 LDAP 读取) 外部用户(存储在 Keycloak 中但未与 LDAP 同步) 我们现在想
在登录 demos ,每个示例都有说明“要关闭登录表单提交非空用户名和密码”的页脚文本。我想复制这个,但添加的不仅仅是文本。我可以打电话LoginI18n#setAdditionalInformati
这是我遇到的错误。 Warning: React.createElement: type is invalid -- expected a string (for built-in component
在从Devise切换到直接使用的过程中Warden . 我怎样才能实现 Devise 开箱即用的“忘记密码”功能? 是否有 gem 可以将此添加到 Warden 上? 附言。不使用 Devise 的原
我正在尝试将忘记密码字段与登录页面放在一起,但如果用户未注册(并且不在应用程序数据库中),则它会重定向到原始设计的忘记密码页面并出现错误 (http://localhost:3000/用户/密码)。如
我正在使用 ASW Cognito 对用户进行身份验证。 Cognito 有一个记录良好的流程来处理忘记密码的用户。 如何处理忘记用户名的用户?是否有内置流程让用户输入他们的电子邮件或电话号码,然后接
我正在使用具有 Azure AAD B2C 配置的 Web 应用程序来进行 IIS 中托管的身份验证。 我已创建注册策略、登录策略和密码重置策略。我也在 Azure Active Directory
我正在尝试实现一个包含“忘记密码?”的登录页面。按钮打开一个表单,然后允许用户提交电子邮件,同时也是用户名,如果 Cognito 中存在该条目,则应启动重置密码过程。 到目前为止,我遇到的问题之一是我
我想知道在网站上创建忘记密码功能的最佳方法是什么。我见过不少这样的东西,这里有一些或它们的组合: 密码问题/答案(1 个或多个) 发送包含新密码的电子邮件 在屏幕上输入新密码 通过电子邮件确认:必须点
我是 Azure AD B2C 的新手,因为 Azure B2C 提供了各种策略和用户流程,例如登录注册等。我们使用的是相同的。由于某种原因,我们考虑使用图形 API(更改密码)来实现忘记密码功能,在
如何从 Azure AD B2C 登录的登录页面中删除“忘记密码”链接。 谢谢。 最佳答案 在技术资料的元数据部分添加: none 选项: AfterLabel (Default) After
如何从 Azure AD B2C 登录的登录页面中删除“忘记密码”链接。 谢谢。 最佳答案 在技术资料的元数据部分添加: none 选项: AfterLabel (Default) After
我是一名优秀的程序员,十分优秀!