Grails 代表其他用户登录web应用程序

Grails 代表其他用户登录web应用程序,grails,single-sign-on,Grails,Single Sign On,我需要允许web应用程序的登录用户代表其他用户执行某些功能 例如,假设我以餐馆老板的身份登录,我想做一些餐馆经理的工作 我应该能够得到餐厅经理的登录页,同时登录到餐厅老板。该应用程序是使用grails构建的,如果大家都能分享您的想法和想法,这将是一个很大的帮助。如果您使用标准的spring security core插件实现身份验证和用户管理,那么它将提供一个能准确处理这种情况的解决方案 <sec:ifLoggedIn> Logged in as <sec:username/&

我需要允许web应用程序的登录用户代表其他用户执行某些功能

例如,假设我以餐馆老板的身份登录,我想做一些餐馆经理的工作


我应该能够得到餐厅经理的登录页,同时登录到餐厅老板。该应用程序是使用grails构建的,如果大家都能分享您的想法和想法,这将是一个很大的帮助。

如果您使用标准的spring security core插件实现身份验证和用户管理,那么它将提供一个能准确处理这种情况的解决方案

<sec:ifLoggedIn>
Logged in as <sec:username/>
</sec:ifLoggedIn>

<sec:ifSwitched>
<a href='${request.contextPath}/j_spring_security_exit_user'>
   Resume as <sec:switchedUserOriginalUsername/>
</a>
</sec:ifSwitched>

<sec:ifNotSwitched>
   <sec:ifAllGranted roles='ROLE_SWITCH_USER'>

   <form action='${request.contextPath}/j_spring_security_switch_user' method='POST'>
      Switch to user: <input type='text' name='j_username'/><br/>
      <input type='submit' value='Switch'/>
   </form>

   </sec:ifAllGranted>
</sec:ifNotSwitched>

登录为
切换到用户:

感谢伊恩的回答。我们将做一个实验和更新。