如何使用keycloak强制每个客户端登录(最佳实践?) [英] How to force login per client with keycloak (¿best practice?)

查看:274
本文介绍了如何使用keycloak强制每个客户端登录(最佳实践?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在实施密钥斗篷,并且面临着一个不确定的问题,即我们不确定解决方案的最佳方法.

We are currently implementing keycloak and we are facing an issue that we are not sure what’s the best way to solve it.

我们有使用sso的不同Web应用,并且运行良好.我们遇到的问题是,当我们在一个Web应用程序中使用sso登录时,然后在另一个Web应用程序中执行相同的操作.

We have different webapps making use of the sso and that’s working fine. The problem we have is when we make log in using the sso in one webapp and then we do the same in a different webapp.

最初,第二个Web应用程序不知道要访问哪个用户(也无需登录即可使用它).单击登录"时,它会自动登录用户(通过重定向到密钥库并自动将已登录的用户登录到另一个Web应用程序中).这第二次记录对用户透明"发生,因为重定向到密钥斗篷的速度非常快,并且不引人注意.这种行为不是很用户友好.

Initially this second webapp does not know which user is coming (and it’s not necessary to be logged in to make use of it). When clicking on "login", it automatically logs in the user (by making a redirection to keycloak and automatically logging the already logged user in the other webapp). This second logging happens "transparently" to the user, since the redirection to keycloak is very fast and it’s not noticeable. This behaviour is not very user friendly.

问题是:考虑到第二个Web应用程序无法预先知道哪个用户正在访问该网站(除非主动重定向到keycloak),是否可以强制始终用户登录特定的keycloak客户端?我的意思是,即使keycloak已经从其他keycloak客户端已经知道了用户/pw,也实际上要向访问者询问用户/pw.

The question is: Taking into account that this second webapp can’t know upfront which user is accessing the site (unless actively redirecting to keycloak), is it possible to force always the users to log in for a specific keycloak client? By this I mean actually ask the visitor for user/pw even if keycloak knows already them from other keycloak clients.

提前谢谢!

推荐答案

在keycloak的邮件列表中,他们为我提供了一个很好的解决方案,但对于版本4:

In the mail listing from keycloak, they gave me a good solution but for version 4:

  1. 在管理控制台中,转到身份验证"
  2. 复制浏览器流程
  3. 在此新流程中,禁用或删除Cookie
  4. 转到客户端"->(您的客户端)->身份验证流替代",将浏览器流"更改为新的流,然后单击保存"."

这篇关于如何使用keycloak强制每个客户端登录(最佳实践?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆