SWS-907 - Become compatible with Spring Security 4
Spring Security 4.0 removed a number of APIs that were deprecated in 3.x. This commit updates SpringSecurityUtils to avoid using those APIs. This makes it compatible with Spring Security 4.0 while also retaining compatibility with Spring Security 3.2.x. Also, upgrade to Spring Security 3.2.7.RELEASE as the latest point release.
This commit is contained in:
committed by
Greg Turnquist
parent
f23ec82273
commit
40c85c48de
@@ -13,7 +13,7 @@ configure(allprojects) {
|
||||
group = "org.springframework.ws"
|
||||
|
||||
ext.springVersion = "4.0.9.RELEASE"
|
||||
ext.springSecurityVersion = "3.2.5.RELEASE"
|
||||
ext.springSecurityVersion = "3.2.7.RELEASE"
|
||||
ext.axiomVersion = "1.2.14"
|
||||
|
||||
apply plugin: "java"
|
||||
|
||||
@@ -42,19 +42,19 @@ public abstract class SpringSecurityUtils {
|
||||
public static void checkUserValidity(UserDetails user)
|
||||
throws AccountExpiredException, CredentialsExpiredException, DisabledException, LockedException {
|
||||
if (!user.isAccountNonLocked()) {
|
||||
throw new LockedException("User account is locked", user);
|
||||
throw new LockedException("Account for user '" + user + "' is locked");
|
||||
}
|
||||
|
||||
if (!user.isEnabled()) {
|
||||
throw new DisabledException("User is disabled", user);
|
||||
throw new DisabledException("User '" + user + "' is disabled");
|
||||
}
|
||||
|
||||
if (!user.isAccountNonExpired()) {
|
||||
throw new AccountExpiredException("User account has expired", user);
|
||||
throw new AccountExpiredException("Account for user '" + user + "' has expired");
|
||||
}
|
||||
|
||||
if (!user.isCredentialsNonExpired()) {
|
||||
throw new CredentialsExpiredException("User credentials have expired", user);
|
||||
throw new CredentialsExpiredException("Credentials for user '" + user + "' have expired");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user