Necessary to allow use of custom SecurityContextRepository.(cherry picked from commit d5df53f1db)
d5df53f1db