File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
main/java/org/springframework/security/web/authentication/switchuser
test/java/org/springframework/security/web/authentication/switchuser Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 5858import org .springframework .security .web .authentication .SimpleUrlAuthenticationFailureHandler ;
5959import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
6060import org .springframework .security .web .authentication .WebAuthenticationDetailsSource ;
61+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
6162import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
6263import org .springframework .security .web .context .SecurityContextRepository ;
6364import org .springframework .security .web .util .UrlUtils ;
@@ -144,7 +145,7 @@ public class SwitchUserFilter extends GenericFilterBean implements ApplicationEv
144145
145146 private AuthenticationFailureHandler failureHandler ;
146147
147- private SecurityContextRepository securityContextRepository = new RequestAttributeSecurityContextRepository ();
148+ private SecurityContextRepository securityContextRepository = new HttpSessionSecurityContextRepository ();
148149
149150 @ Override
150151 public void afterPropertiesSet () {
Original file line number Diff line number Diff line change 4747import org .springframework .security .util .FieldUtils ;
4848import org .springframework .security .web .DefaultRedirectStrategy ;
4949import org .springframework .security .web .authentication .SimpleUrlAuthenticationSuccessHandler ;
50- import org .springframework .security .web .context .RequestAttributeSecurityContextRepository ;
50+ import org .springframework .security .web .context .HttpSessionSecurityContextRepository ;
5151import org .springframework .security .web .context .SecurityContextRepository ;
5252import org .springframework .security .web .util .matcher .AnyRequestMatcher ;
5353import org .springframework .test .util .ReflectionTestUtils ;
@@ -491,10 +491,10 @@ public void setSwitchFailureUrlWhenValidThenNoException() {
491491 }
492492
493493 @ Test
494- void filterWhenDefaultSecurityContextRepositoryThenRequestAttributeRepository () {
494+ void filterWhenDefaultSecurityContextRepositoryThenHttpSessionRepository () {
495495 SwitchUserFilter switchUserFilter = new SwitchUserFilter ();
496496 assertThat (ReflectionTestUtils .getField (switchUserFilter , "securityContextRepository" ))
497- .isInstanceOf (RequestAttributeSecurityContextRepository .class );
497+ .isInstanceOf (HttpSessionSecurityContextRepository .class );
498498 }
499499
500500 @ Test
You can’t perform that action at this time.
0 commit comments