Skip to content

Commit 88a3801

Browse files
minseok.parkjzheaux
minseok.park
authored andcommitted
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. Closes PR-16710 Signed-off-by: minseok.park <[email protected]>
1 parent 3499646 commit 88a3801

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

+2
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)