当前位置:网站首页>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;
}
*/边栏推荐
- 注解的定义以及注解编译器
- Common basic functions of R language: call the data editor with edit function to manually customize and edit the data object without changing the content of the original data object, and call the data
- Unity中的地平面简介
- stm32mp1 Cortex M4开发篇9:扩展板空气温湿度传感器控制
- 一条命令开启监控之旅!
- Judge the data type of JS
- The most authoritative Lei niukesi in history --- embedded Ai Road line [yyds]
- [JUC series] completionservice of executor framework
- 并发编程高级部分:并行流,Tasks和Executors以及CompletableFuture类
- Style penetration of vant UI components -- that is, some styles in vant UI components cannot be modified
猜你喜欢
![[actual combat] STM32 FreeRTOS porting series Tutorial 4: FreeRTOS software timer](/img/16/ad38288689f629106a19a0b8defea2.jpg)
[actual combat] STM32 FreeRTOS porting series Tutorial 4: FreeRTOS software timer

Summary of Web automated testing

Alibaba cloud OSS uploading and intelligent image recognition garbage recognition

Ali has been working for 8 years. This learning note is left when he reaches P8. He has helped his friends get 10 offers

TC software detailed design document (mobile group control)
![[practice] stm32mp157 development tutorial FreeRTOS system 3: FreeRTOS counting semaphore](/img/b1/e4b944877fecc079a772b81c55bfc8.jpg)
[practice] stm32mp157 development tutorial FreeRTOS system 3: FreeRTOS counting semaphore

Stm32mp1 cortex M4 Development Chapter 11: expansion board buzzer control

PingCAP 入选 2022 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分

Stm32mp1 cortex M4 development part 12: expansion board vibration motor control

Stm32mp1 cortex M4 development part 10: expansion board nixie tube control
随机推荐
Versions supported by vuforia engine
如何做一个有趣的人
[vs], [usage problem], [solution] when VS2010 is opened, it stays in the startup interface
Alibaba cloud OSS uploading and intelligent image recognition garbage recognition
A command starts the monitoring journey!
ArCore支持的设备
The R language plot function visualizes multiple lines in the same plot, and uses the BMP function to save the visualization image to the BMP format file in the specified directory
Concurrency - condition variable
并发-条件变量
【实战】STM32MP157开发教程之FreeRTOS系统篇6:FreeRTOS 列表和列表项
Waiting in webdriver
Audio and video synchronization knowledge points you must pay attention to:
TC软件概要设计文档(手机群控)
【云原生 | Kubernetes篇】Kubernetes 配置(十五)
Mobile applications introduce static Cordova according to different platforms
How to select embedded hands-on projects and embedded open source projects
Introduction and template of segment tree Foundation (I)
Float floating layout clear floating
并发编程高级部分:并行流,Tasks和Executors以及CompletableFuture类
115. secondary packaging of table components