|
|
|
@ -145,10 +145,15 @@ public abstract class AbstractUserDetailsAuthenticationProvider implements Authe |
|
|
|
try { |
|
|
|
try { |
|
|
|
additionalAuthenticationChecks(user, (UsernamePasswordAuthenticationToken) authentication); |
|
|
|
additionalAuthenticationChecks(user, (UsernamePasswordAuthenticationToken) authentication); |
|
|
|
} catch (AuthenticationException exception) { |
|
|
|
} catch (AuthenticationException exception) { |
|
|
|
// There was a problem, so try again after checking we're using latest data
|
|
|
|
if(cacheWasUsed) { |
|
|
|
cacheWasUsed = false; |
|
|
|
// There was a problem, so try again after checking
|
|
|
|
user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication); |
|
|
|
// we're using latest data (ie not from the cache)
|
|
|
|
additionalAuthenticationChecks(user, (UsernamePasswordAuthenticationToken) authentication); |
|
|
|
cacheWasUsed = false; |
|
|
|
|
|
|
|
user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication); |
|
|
|
|
|
|
|
additionalAuthenticationChecks(user, (UsernamePasswordAuthenticationToken) authentication); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
throw exception; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!user.isCredentialsNonExpired()) { |
|
|
|
if (!user.isCredentialsNonExpired()) { |
|
|
|
|