我使用authenticate
方法自定义了AuthenticationProvider
。AuthenticationProvider身份验证在IE中调用了两次,但无法登录
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
> Check username, password, throw exceptions where needed
return new CustomAuthenticationToken(username, grantedAuthorities);
}
和令牌:
public class CustomAuthenticationToken extends UsernamePasswordAuthenticationToken
{
public CustomAuthenticationToken(ICurrentUserContext currentUser, List<GrantedAuthority> authorities) {
super(currentUser.getUsername(), currentUser.getPassword(), authorities);
}
}
当我使用Chrome,火狐登录,也没有任何问题。
在IE 8/9中,我有一个很奇怪的问题。有时它只会调用方法authenticate
一次,它会登录并且一切按预期工作。但时不时会拨打authenticate
两次,并且未能登录。
有没有人有任何线索?
我已经在Tomcat btw上测试过它。
这没有任何意义。除了在响应中设置新的JSESSIONID cookie之外,浏览器不应该知道会话迁移的任何内容。请看看我的单独答案,看看是否适用。由于这有助于特定目的,因此最好避免禁用它。 –