Skip to content

Commit

Permalink
Update comment in additionalAuthenticationChecks to clarify why our…
Browse files Browse the repository at this point in the history
… no-op implementation is ok
  • Loading branch information
dwnusbaum committed Jan 9, 2025
1 parent a49c83c commit 2a55c2e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ public GroupDetails loadGroupByGroupname(String groupname) throws org.acegisecur
class Authenticator extends AbstractUserDetailsAuthenticationProvider {
@Override
protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
// authentication is assumed to be done already in the retrieveUser method
// Authentication is done in the retrieveUser method. Note that this method being a no-op is only safe
// because we use Spring Security's default NullUserCache. If caching was enabled, it would be possible to
// log in as any cached user with any password unless we updated this method to check the provided
// authentication as recommended in the superclass method's documentation, so be careful reusing this code.
}

@Override
Expand Down

0 comments on commit 2a55c2e

Please sign in to comment.