Skip to content

Commit 52c7ee0

Browse files
EliuXgregturn
authored andcommitted
Adds UserDetails to Authentication.
Add the `UserDetails` object to the `Authentication` during Spring Security password callbacks. Resolves #109.
1 parent 5ed0738 commit 52c7ee0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/callback/SpringSecurityPasswordValidationCallbackHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callb
9292
if (logger.isDebugEnabled()) {
9393
logger.debug("Authentication success: " + authRequest.toString());
9494
}
95+
authRequest.setDetails(user);
9596
SecurityContextHolder.getContext().setAuthentication(authRequest);
9697
}
9798

spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/callback/SpringSecurityPasswordValidationCallbackHandlerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ public void testHandleUsernameTokenPrincipal() throws Exception {
125125
assertThat(authorities).isNotEmpty();
126126
assertThat(authorities.iterator().next()).isEqualTo(grantedAuthority);
127127

128+
assertThat(authentication.getDetails()).isEqualTo(user);
129+
128130
verify(userDetailsService);
129131
}
130132
}

0 commit comments

Comments
 (0)