楼主应该早就解决了,不过为了后来人,我回答下,
在自定义realm里的认证方法要返回的信息AuthenticationInfo,简单的说就是principalCollection里的内容,所以只需要在doGetAuthenticationInfo(AuthenticationToken token)方法里,
SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
userInfo, //用户信息类
userInfo.getPassword(), //密码
ByteSource.Util.bytes(userInfo.getCredentialsSalt()),//salt=username+salt
getName() //realm name
);
return authenticationInfo;
userInfo是怎么来的就不用说了吧