Comments (8)
from shiro-redis.
from shiro-redis.
from shiro-redis.
from shiro-redis.
按照你的文档改了,仍然报同样的错。
代码如下:
//登录验证
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
String userCode = (String) authenticationToken.getPrincipal();
String password = new String((char[]) authenticationToken.getCredentials());
// 查询用户信息
SysUserDTO sysUser = sysApiService.getLoginUserByUserCode(userCode);
if (null == sysUser) {
throw new UnknownAccountException();
}
if (!sysUser.getPassword().equals(MD5Util.MD5(password + sysUser.getSalt()))) {
throw new IncorrectCredentialsException();
}
if (sysUser.getUseable() == 0) {
throw new LockedAccountException();
}
UserInfo userInfo = new UserInfo();
BeanUtils.copyProperties(sysUser, userInfo);
AuthenticationInfo authcInfo = new SimpleAuthenticationInfo(userInfo, password, getName());
UserInfo.java
public class UserInfo implements Serializable, AuthCachePrincipal {
private static final long serialVersionUID = -6477843453976551075L;
private String id;
private String userCode;
private String userName;
...
@Override
public String getAuthCacheKey() {
return this.getUserCode();
}
}
from shiro-redis.
可否断点调试 RedisCache 类 line 133:
if (!(principalCollection.getPrimaryPrincipal() instanceof AuthCachePrincipal)) {
throw new PrincipalInstanceException();
}
观察此处 principalCollection.getPrimaryPrincipal() 取出的对象是否是UserInfo对象?
from shiro-redis.
Any updates?
from shiro-redis.
请升级至3.1.0,3.1.0取消了AuthCachePrincipal接口,转而使用反射来获取auth的redis对象id,请在 cacheManager.principalIdFieldName
中配置id字段,具体请参考README.md
from shiro-redis.
Related Issues (20)
- RedisSessionDAO出现AQS线程阻塞
- shiro redis 版本从3.0.0升级到3.3.1登录报 UnknownSessionException
- shiro-redis.cache-manager.expire
- 3.3.2版本怎么这和久都不发布啊 HOT 5
- 报错java.net.SocketTimeoutException: Read timed out HOT 1
- 在SecurityUtils.getSubject().logout()时报错
- com.puppycrawl.tools:checkstyle 代码问题漏洞(CVE-2019-10782)
- Apache Shiro < 1.8.0 have a problem that Authentication bypasses the vulnerability(CVE-2021-41303)
- shiro-redis 3.3.1 程序启动后 每隔一个小时 redis 实例 cpu 升高 HOT 2
- There is no session with id HOT 1
- redis4.x版本,直接报错,只能使用3.x版本 HOT 13
- [微服务之间的session共享],请问有什么方案推荐么?
- bug:There is no session with id
- shiro-core version need update to 1.7 or larger HOT 1
- 使用redis哨兵模式时 连接redis哨兵报错NOAUTH Authentication required HOT 1
- 偶发的NPE异常
- Spring Boot 3.1.4 使用的时候报错 java.lang.NoSuchMethodError: 'java.lang.Long redis.clients.jedis.Jedis.del(byte[])' HOT 5
- shiro-redis使用自定义的RedisSerializer出现的问题
- sessionInMemoryEnabled 打开后,内存占用较高 HOT 1
- Shiro-redis not working for clustered AWS elastic cache
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiro-redis.