当前位置:网站首页>Odd number of characters异常
Odd number of characters异常
2022-06-21 09:34:00 【sunonzj】
Java.lang.IllegalArgumentException: Odd number of characters. at org.apache.shiro.codec.Hex.decode(Hex.java:128) ~[shiro-core-1.3.2.jar:1.3.2] at org.apache.shiro.codec.Hex.decode(Hex.java:107) ~[shiro-core-1.3.2.jar:1.3.2] at org.apache.shiro.codec.Hex.decode(Hex.java:95) ~[shiro-core-1.3.2.jar:1.3.2] at org.apache.shiro.authc.credential.HashedCredentialsMatcher.getCredentials(HashedCredentialsMatcher.java:353) ~[shiro-core-1.3.2.jar:1.3.2] at org.apache.shiro.authc.credential.HashedCredentialsMatcher.doCredentialsMatch(HashedCredentialsMatcher.java:380) ~[shiro-core-1.3.2.jar:1.3.2] at org.apache.shiro.realm.AuthenticatingRealm.assertCredentialsMatch(AuthenticatingRealm.java:597) ~[shiro-core-1.3.2.jar:1.3.2]
原因一: 使用shiro登入认证的 return new SimpleAuthenticationInfo(token.getPrincipal(), password, salt, getName()); 传参数的时候password 要使用加密过的。
原因二:后面整合jwt 改成了
return new SimpleAuthenticationInfo(token, token, getName());需要把这段去掉 不然也会报这个错
/**
* HashedCredentialsMatcher,这个类是为了对密码进行编码的,
* 防止密码在数据库里明码保存,当然在登陆认证的时候,
* 这个类也负责对form里输入的密码进行编码。
*//*
@Bean(name = "hashedCredentialsMatcher")
public HashedCredentialsMatcher hashedCredentialsMatcher() {
HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
credentialsMatcher.setHashAlgorithmName("MD5");
credentialsMatcher.setHashIterations(2);
credentialsMatcher.setStoredCredentialsHexEncoded(true);
return credentialsMatcher;
}
*/边栏推荐
- The most authoritative Lei niukesi in history --- embedded Ai Road line [yyds]
- Telecommuting Market Research Report
- 内部类
- C#中的list操作入门
- How to select embedded hands-on projects and embedded open source projects
- 信号功率谱估计
- How do I listen for changes in DOM element size?
- 多态&Class对象&注册工厂&反射&动态代理
- 110. JS event loop and setimmediate, process.nexttick
- Observation on the salary data of the post-90s: poor, counselled and serious
猜你喜欢

Zhihu wanzan: what kind of programmers are still wanted by the company after the age of 35? Breaking the "middle age crisis" of programmers

Stm32mp1 cortex M4 development part 10: expansion board nixie tube control

一条命令开启监控之旅!

TC software detailed design document (mobile group control)

A command starts the monitoring journey!

It is only seven days since the commencement of construction in 2022. I left the outsourcing company
![[actual combat] STM32 FreeRTOS migration series tutorial 7: FreeRTOS event flag group](/img/1c/10add042271c11cd129ddfce66f719.jpg)
[actual combat] STM32 FreeRTOS migration series tutorial 7: FreeRTOS event flag group

Are you still using localstorage directly? The thinnest in the whole network: secondary encapsulation of local storage (including encryption, decryption and expiration processing)

108. detailed use of Redux (case)

Alibaba cloud OSS uploading and intelligent image recognition garbage recognition
随机推荐
equals 和 hashCode
Android database upgrade
The next stop of Intelligent Manufacturing: cloud native + edge computing two wheel drive
[practice] stm32mp157 development tutorial FreeRTOS system 3: FreeRTOS counting semaphore
character string
TC software detailed design document (mobile group control)
TC software outline design document (mobile group control)
QRcode dependency
Solve the problem of error when typescript object gets value
2. the development of the meta universe
应用配置管理,基础原理分析
110. JS event loop and setimmediate, process.nexttick
The internal structure of MySQL and how an SQL statement is executed
Vuforia引擎支持的版本
ADO. Net - invalid size for size property, 0 - ado NET - The Size property has an invalid size of 0
Float floating layout clear floating
Appareils pris en charge par Arcore
Prefix sum and difference
Stm32mp1 cortex M4 development part 8: LED lamp control experiment of expansion board
[practice] STM32 FreeRTOS porting series tutorial 1: use of FreeRTOS binary semaphores