mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-27 06:12:27 +00:00
SEC-638: Fixed problem caused by using Spring 2.5.1 method from ReflectionUtils which isn't available in 2.0.6.
This commit is contained in:
parent
eb70db1dee
commit
568211b77f
@ -67,7 +67,7 @@ public class ReflectionSaltSource implements SaltSource, InitializingBean {
|
|||||||
public Object getSalt(UserDetails user) {
|
public Object getSalt(UserDetails user) {
|
||||||
Method saltMethod = findSaltMethod(user);
|
Method saltMethod = findSaltMethod(user);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return saltMethod.invoke(user, new Object[] {});
|
return saltMethod.invoke(user, new Object[] {});
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
throw new AuthenticationServiceException(exception.getMessage(), exception);
|
throw new AuthenticationServiceException(exception.getMessage(), exception);
|
||||||
@ -75,7 +75,7 @@ public class ReflectionSaltSource implements SaltSource, InitializingBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Method findSaltMethod(UserDetails user) {
|
private Method findSaltMethod(UserDetails user) {
|
||||||
Method saltMethod = ReflectionUtils.findMethod(user.getClass(), userPropertyToUse);
|
Method saltMethod = ReflectionUtils.findMethod(user.getClass(), userPropertyToUse, new Class[0]);
|
||||||
|
|
||||||
if (saltMethod == null) {
|
if (saltMethod == null) {
|
||||||
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(user.getClass(), userPropertyToUse);
|
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(user.getClass(), userPropertyToUse);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user