使用Spring security在多后端webapp中切换角色
我正在使用Java6在Tomcat6上开发一个多后端webapp。我正在使用SpringSecurity3.1.0.RELEASE和LDAP来检查登录密码,并使用自定义填充器从我的数据库中获取角色。一切正常 我还使用Pretty faces 3.3.2解析URL 我的填充器看起来像使用Spring security在多后端webapp中切换角色,spring,spring-security,roles,Spring,Spring Security,Roles,我正在使用Java6在Tomcat6上开发一个多后端webapp。我正在使用SpringSecurity3.1.0.RELEASE和LDAP来检查登录密码,并使用自定义填充器从我的数据库中获取角色。一切正常 我还使用Pretty faces 3.3.2解析URL 我的填充器看起来像 public abstract class MyAuthoritiesPopulator implements LdapAuthoritiesPopulator { @Autowired private UserS
public abstract class MyAuthoritiesPopulator implements LdapAuthoritiesPopulator {
@Autowired
private UserService userService;
@Override
public final Collection<? extends GrantedAuthority> getGrantedAuthorities(DirContextOperations userData, String username) {
final List<GrantedAuthority> authorities = newArrayList();
authorities.addAll(userService.findRoleFromDataBase(...));
return authorities;
}
在我的webapp中,我使用URL选择目标后端
我的URL看起来像www.mycorp.com/mywebapp/myaction/mylang/mybackend/someotherparam。。。
例如,如果mybackend参数等于45,那么我将获得简单的用户角色。如果mybackend参数等于32,那么我将获得管理员和转换器角色。等等
只要我连接了ie。登录密码与LDAP一致,我就可以从一个后端切换到另一个后端,只需更改URL。但是我如何要求Spring security重新加载ie。根据mybackend参数重新填充角色
谢谢你的帮助。
Th