Skip to content

Commit 40c85c4

Browse files
wilkinsonagregturn
authored andcommitted
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.
1 parent f23ec82 commit 40c85c4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ configure(allprojects) {
1313
group = "org.springframework.ws"
1414

1515
ext.springVersion = "4.0.9.RELEASE"
16-
ext.springSecurityVersion = "3.2.5.RELEASE"
16+
ext.springSecurityVersion = "3.2.7.RELEASE"
1717
ext.axiomVersion = "1.2.14"
1818

1919
apply plugin: "java"

spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/SpringSecurityUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ public abstract class SpringSecurityUtils {
4242
public static void checkUserValidity(UserDetails user)
4343
throws AccountExpiredException, CredentialsExpiredException, DisabledException, LockedException {
4444
if (!user.isAccountNonLocked()) {
45-
throw new LockedException("User account is locked", user);
45+
throw new LockedException("Account for user '" + user + "' is locked");
4646
}
4747

4848
if (!user.isEnabled()) {
49-
throw new DisabledException("User is disabled", user);
49+
throw new DisabledException("User '" + user + "' is disabled");
5050
}
5151

5252
if (!user.isAccountNonExpired()) {
53-
throw new AccountExpiredException("User account has expired", user);
53+
throw new AccountExpiredException("Account for user '" + user + "' has expired");
5454
}
5555

5656
if (!user.isCredentialsNonExpired()) {
57-
throw new CredentialsExpiredException("User credentials have expired", user);
57+
throw new CredentialsExpiredException("Credentials for user '" + user + "' have expired");
5858
}
5959
}
6060
}

0 commit comments

Comments
 (0)