Skip to content

Commit 244b6fb

Browse files
author
minseok.park
committed
Add validation for auth checks in AbstractUserDetailsAuthenticationProvider
Add assertions to validate that preAuthenticationChecks and postAuthenticationChecks are not null during initialization. This allows errors to be detected earlier in the application lifecycle. Signed-off-by: minseok.park <[email protected]>
1 parent c7673e8 commit 244b6fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/main/java/org/springframework/security/authentication/dao/AbstractUserDetailsAuthenticationProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ protected abstract void additionalAuthenticationChecks(UserDetails userDetails,
117117
public final void afterPropertiesSet() throws Exception {
118118
Assert.notNull(this.userCache, "A user cache must be set");
119119
Assert.notNull(this.messages, "A message source must be set");
120+
Assert.notNull(this.preAuthenticationChecks, "A pre authentication checks must be set");
121+
Assert.notNull(this.postAuthenticationChecks, "A post authentication checks must be set");
120122
doAfterPropertiesSet();
121123
}
122124

0 commit comments

Comments
 (0)