Ra-authenticate在Grails应用程序中更改用户 [英] Ra-authenticate Changed User in Grails Application

查看:112
本文介绍了Ra-authenticate在Grails应用程序中更改用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想立即在我的Grails应用程序中传播用户更改(更改用户角色)(我使用Spring Security Plugin)。



我发现这:

  springSecurityService.reauthenticate(userName)

但是这对于当前登录的用户是有效的,而不是为了更改!



有没有简单的解决方案注销已更改的用户就足够了)。



这种情况下的用例是当管理员更改其他用户角色时。如果更改后的用户登录,则角色更改不会立即在Spring Security的上下文中看到。 你必须声明一个弹簧安全SessionRegistry。看看这里并发 - 会话和这里 list-authenticated-principals

然后,您可以列出并访问经过身份验证的用户并对其进行修改。


I would like to immediately propagate user changes (change of user roles) in my Grails application (I'm using Spring Security Plugin).

I've found this:

springSecurityService.reauthenticate(userName)

but this works for currently logged user, not for the change one!

Is there any easy solution for this (even force logout of changed users will suffice me).

The use-case for this is when the admin change some other user role. If the changed user is logged in, the role change isn't seen immediately in the context of Spring Security.

解决方案

I think you have to declare a spring security SessionRegistry. Take a look here concurrent-sessions and here list-authenticated-principals.

Then you can list and access authenticated users and modify them.

这篇关于Ra-authenticate在Grails应用程序中更改用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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